Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isObjectMoving to server side #3378

Merged
merged 5 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Server/mods/deathmatch/logic/luadefs/CLuaObjectDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ void CLuaObjectDefs::LoadFunctions()
{"getObjectRotation", GetObjectRotation},
{"getObjectScale", GetObjectScale},
{"isObjectBreakable", ArgumentParser<IsObjectBreakable>},
{"isObjectMoving", ArgumentParser<IsObjectMoving>},

// Object set funcs
{"setObjectRotation", SetObjectRotation},
Expand All @@ -50,6 +51,7 @@ void CLuaObjectDefs::AddClass(lua_State* luaVM)
lua_classfunction(luaVM, "setScale", "setObjectScale");
lua_classfunction(luaVM, "isBreakable", "isObjectBreakable");
lua_classfunction(luaVM, "setBreakable", "setObjectBreakable");
lua_classfunction(luaVM, "isMoving", "isObjectMoving");

lua_classvariable(luaVM, "scale", "setObjectScale", "getObjectScale");
lua_classvariable(luaVM, "breakable", "setObjectBreakable", "isObjectBreakable");
Expand Down Expand Up @@ -222,6 +224,11 @@ int CLuaObjectDefs::SetObjectScale(lua_State* luaVM)
return 1;
}

bool CLuaObjectDefs::IsObjectMoving(CObject* const pObject)
FileEX marked this conversation as resolved.
Show resolved Hide resolved
{
return pObject->IsMoving();
}

int CLuaObjectDefs::MoveObject(lua_State* luaVM)
{
// bool moveObject ( object theObject, int time,
Expand Down
1 change: 1 addition & 0 deletions Server/mods/deathmatch/logic/luadefs/CLuaObjectDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class CLuaObjectDefs : public CLuaDefs
LUA_DECLARE(GetObjectRotation);
LUA_DECLARE(GetObjectScale);
static bool IsObjectBreakable(CObject* const pObject);
static bool IsObjectMoving(CObject* const pObject);

// Object set functions
LUA_DECLARE(SetObjectName);
Expand Down
Loading