Skip to content

Commit

Permalink
Clouds API: change speed from 'y' to 'z', ColorSpecs in Lua docs (#6164)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendeutsch authored and nerzhul committed Jul 24, 2017
1 parent befc3bb commit c50a57c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions doc/lua_api.txt
Expand Up @@ -3306,11 +3306,12 @@ This is basically a reference to a C++ `ServerActiveObject`
* `set_clouds(parameters)`: set cloud parameters
* `parameters` is a table with the following optional fields:
* `density`: from `0` (no clouds) to `1` (full clouds) (default `0.4`)
* `color`: basic cloud color, with alpha channel (default `#fff0f0e5`)
* `ambient`: cloud color lower bound, use for a "glow at night" effect (default `#000000`)
* `color`: basic cloud color with alpha channel, ColorSpec (default `#fff0f0e5`)
* `ambient`: cloud color lower bound, use for a "glow at night" effect.
ColorSpec (alpha ignored, default `#000000`)
* `height`: cloud height, i.e. y of cloud base (default per conf, usually `120`)
* `thickness`: cloud thickness in nodes (default `16`)
* `speed`: 2D cloud speed + direction in nodes per second (default `{x=0, y=-2}`)
* `speed`: 2D cloud speed + direction in nodes per second (default `{x=0, z=-2}`)
* `get_clouds()`: returns a table with the current cloud parameters as in `set_clouds`
* `override_day_night_ratio(ratio or nil)`
* `0`...`1`: Overrides day-night ratio, controlling sunlight to a specific amount
Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_object.cpp
Expand Up @@ -1766,7 +1766,7 @@ int ObjectRef::l_set_clouds(lua_State *L)
if (lua_istable(L, -1)) {
v2f new_speed;
new_speed.X = getfloatfield_default(L, -1, "x", 0);
new_speed.Y = getfloatfield_default(L, -1, "y", 0);
new_speed.Y = getfloatfield_default(L, -1, "z", 0);
cloud_params.speed = new_speed;
}
lua_pop(L, 1);
Expand Down

0 comments on commit c50a57c

Please sign in to comment.