Skip to content

Commit

Permalink
Added isObjectMoving to server side
Browse files Browse the repository at this point in the history
  • Loading branch information
FileEX committed May 1, 2024
1 parent 1f2c6e7 commit 99a2220
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8155,6 +8155,17 @@ bool CStaticFunctionDefinitions::SetObjectScale(CElement* pElement, const CVecto
return false;
}

bool CStaticFunctionDefinitions::IsObjectMoving(CElement* pElement)
{
if (IS_OBJECT(pElement))
{
CObject* pObject = static_cast<CObject*>(pElement);
return pObject->IsMoving();
}

return false;
}

bool CStaticFunctionDefinitions::MoveObject(CResource* pResource, CElement* pElement, unsigned long ulTime, const CVector& vecPosition,
const CVector& vecRotation, CEasingCurve::eType a_easingType, double a_fEasingPeriod, double a_fEasingAmplitude,
double a_fEasingOvershoot)
Expand Down
1 change: 1 addition & 0 deletions Server/mods/deathmatch/logic/CStaticFunctionDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ class CStaticFunctionDefinitions
static bool GetObjectRotation(CObject* pObject, CVector& vecRotation);
static bool IsObjectVisibleInAllDimensions(CElement* pElement);
static bool IsObjectBreakable(CElement* pElement);
static bool IsObjectMoving(CElement* pElement);

// Object set functions
static bool SetObjectRotation(CElement* pElement, const CVector& vecRotation);
Expand Down
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)
{
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

0 comments on commit 99a2220

Please sign in to comment.