mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-29 07:32:02 +00:00
Expose camera->reset to Lua
This commit is contained in:
parent
610effb8ea
commit
a0c7c08bb7
1 changed files with 8 additions and 0 deletions
|
@ -167,6 +167,7 @@ enum cameraf {
|
|||
camera_x,
|
||||
camera_y,
|
||||
camera_z,
|
||||
camera_reset,
|
||||
camera_angle,
|
||||
camera_subsector,
|
||||
camera_floorz,
|
||||
|
@ -185,6 +186,7 @@ static const char *const camera_opt[] = {
|
|||
"x",
|
||||
"y",
|
||||
"z",
|
||||
"reset",
|
||||
"angle",
|
||||
"subsector",
|
||||
"floorz",
|
||||
|
@ -338,6 +340,9 @@ static int camera_get(lua_State *L)
|
|||
case camera_z:
|
||||
lua_pushinteger(L, cam->z);
|
||||
break;
|
||||
case camera_reset:
|
||||
lua_pushboolean(L, cam->reset);
|
||||
break;
|
||||
case camera_angle:
|
||||
lua_pushinteger(L, cam->angle);
|
||||
break;
|
||||
|
@ -384,6 +389,9 @@ static int camera_set(lua_State *L)
|
|||
case camera_x:
|
||||
case camera_y:
|
||||
return luaL_error(L, LUA_QL("camera_t") " field " LUA_QS " should not be set directly. Use " LUA_QL("P_TryCameraMove") " or " LUA_QL("P_TeleportCameraMove") " instead.", camera_opt[field]);
|
||||
case camera_reset:
|
||||
cam->reset = luaL_checkboolean(L, 3);
|
||||
break;
|
||||
case camera_chase: {
|
||||
INT32 chase = luaL_checkboolean(L, 3);
|
||||
if (cam == &camera)
|
||||
|
|
Loading…
Reference in a new issue