@@ -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" );
@@ -3751,20 +3753,21 @@ int CLuaVehicleDefs::IsVehicleWindowOpen(lua_State* luaVM)
37513753
37523754int CLuaVehicleDefs::SetVehicleModelExhaustFumesPosition (lua_State* luaVM)
37533755{
3754- // bool setVehicleModelExhaustPosition( int modelID, float x, float y, float z)
3755- unsigned short modelID ;
3756- CVector position ;
3756+ // bool setVehicleModelExhaustPosition ( int modelID, float x, float y, float z )
3757+ unsigned short usModel ;
3758+ CVector vecPosition ;
37573759
37583760 CScriptArgReader argStream (luaVM);
3759- argStream.ReadNumber (modelID );
3760- argStream.ReadVector3D (position );
3761+ argStream.ReadNumber (usModel );
3762+ argStream.ReadVector3D (vecPosition );
37613763
37623764 if (!argStream.HasErrors ())
37633765 {
3764- CClientVehicle::SetModelExhaustFumesPosition (modelID, position);
3765-
3766- lua_pushboolean (luaVM, true );
3767- return 1 ;
3766+ if (CStaticFunctionDefinitions::SetVehicleModelExhaustFumesPosition (usModel, vecPosition))
3767+ {
3768+ lua_pushboolean (luaVM, true );
3769+ return 1 ;
3770+ }
37683771 }
37693772 else
37703773 m_pScriptDebugging->LogCustom (luaVM, argStream.GetFullErrorMessage ());
@@ -3775,20 +3778,48 @@ int CLuaVehicleDefs::SetVehicleModelExhaustFumesPosition(lua_State* luaVM)
37753778
37763779int CLuaVehicleDefs::GetVehicleModelExhaustFumesPosition (lua_State* luaVM)
37773780{
3778- // bool getVehicleModelExhaustPosition( int modelID)
3779- unsigned short modelID ;
3781+ // float, float, float getVehicleModelExhaustPosition ( int modelID )
3782+ unsigned short usModel ;
37803783
37813784 CScriptArgReader argStream (luaVM);
3782- argStream.ReadNumber (modelID );
3785+ argStream.ReadNumber (usModel );
37833786
37843787 if (!argStream.HasErrors ())
37853788 {
3786- CVector position = CClientVehicle::GetModelExhaustFumesPosition (modelID);
3789+ CVector vecPosition;
3790+
3791+ if (CStaticFunctionDefinitions::GetVehicleModelExhaustFumesPosition (usModel, vecPosition))
3792+ {
3793+ lua_pushnumber (luaVM, vecPosition.fX );
3794+ lua_pushnumber (luaVM, vecPosition.fY );
3795+ lua_pushnumber (luaVM, vecPosition.fZ );
3796+ return 3 ;
3797+ }
3798+ }
3799+ else
3800+ m_pScriptDebugging->LogCustom (luaVM, argStream.GetFullErrorMessage ());
37873801
3788- lua_pushnumber (luaVM, position.fX );
3789- lua_pushnumber (luaVM, position.fY );
3790- lua_pushnumber (luaVM, position.fZ );
3791- return 3 ;
3802+ lua_pushboolean (luaVM, false );
3803+ return 1 ;
3804+ }
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::GetVehicleModelExhaustFumesPosition (usModel, vecPosition))
3819+ {
3820+ lua_pushvector (luaVM, vecPosition);
3821+ return 1 ;
3822+ }
37923823 }
37933824 else
37943825 m_pScriptDebugging->LogCustom (luaVM, argStream.GetFullErrorMessage ());
0 commit comments