Skip to content

Commit 7e38d75

Browse files
committed
CLuaVehicleDefs: add ModelExhaustFumes OOP methods
1 parent f36fd7f commit 7e38d75

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ void CLuaVehicleDefs::AddClass(lua_State* luaVM)
205205
lua_classfunction(luaVM, "getUpgradeSlotName", "getVehicleUpgradeSlotName");
206206
lua_classfunction(luaVM, "getCompatibleUpgrades", "getVehicleCompatibleUpgrades");
207207
lua_classfunction(luaVM, "getUpgradeOnSlot", "getVehicleUpgradeOnSlot");
208+
lua_classfunction(luaVM, "getModelExhaustFumesPosition", OOP_GetVehicleModelExhaustFumesPosition);
208209

209210
lua_classfunction(luaVM, "setComponentVisible", "setVehicleComponentVisible");
210211
lua_classfunction(luaVM, "setSirensOn", "setVehicleSirensOn");
@@ -245,6 +246,7 @@ void CLuaVehicleDefs::AddClass(lua_State* luaVM)
245246
lua_classfunction(luaVM, "setColor", "setVehicleColor");
246247
lua_classfunction(luaVM, "setPlateText", "setVehiclePlateText");
247248
lua_classfunction(luaVM, "setGravity", "setVehicleGravity");
249+
lua_classfunction(luaVM, "setModelExhaustFumesPosition", "setVehicleModelExhaustFumesPosition");
248250

249251
lua_classfunction(luaVM, "resetComponentPosition", "resetVehicleComponentPosition");
250252
lua_classfunction(luaVM, "resetComponentRotation", "resetVehicleComponentRotation");
@@ -3800,3 +3802,28 @@ int CLuaVehicleDefs::GetVehicleModelExhaustFumesPosition(lua_State* luaVM)
38003802
lua_pushboolean(luaVM, false);
38013803
return 1;
38023804
}
3805+
3806+
int CLuaVehicleDefs::OOP_GetVehicleModelExhaustFumesPosition(lua_State* luaVM)
3807+
{
3808+
// float, float, float getVehicleModelExhaustPosition ( int modelID )
3809+
unsigned short usModel;
3810+
3811+
CScriptArgReader argStream(luaVM);
3812+
argStream.ReadNumber(usModel);
3813+
3814+
if (!argStream.HasErrors())
3815+
{
3816+
CVector vecPosition;
3817+
3818+
if (CStaticFunctionDefinitions::GetModelExhaustFumesPosition(usModel, vecPosition))
3819+
{
3820+
lua_pushvector(luaVM, vecPosition);
3821+
return 1;
3822+
}
3823+
}
3824+
else
3825+
m_pScriptDebugging->LogCustom(luaVM, argStream.GetFullErrorMessage());
3826+
3827+
lua_pushboolean(luaVM, false);
3828+
return 1;
3829+
}

Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class CLuaVehicleDefs : public CLuaDefs
137137
LUA_DECLARE(SetVehicleWindowOpen);
138138

139139
LUA_DECLARE(SetVehicleModelExhaustFumesPosition);
140-
LUA_DECLARE(GetVehicleModelExhaustFumesPosition);
140+
LUA_DECLARE_OOP(GetVehicleModelExhaustFumesPosition);
141141

142142
// Components
143143
LUA_DECLARE(SetVehicleComponentPosition);

0 commit comments

Comments
 (0)