@@ -84,6 +84,7 @@ void CLuaVehicleDefs::LoadFunctions()
8484 CLuaCFunctions::AddFunction (" setVehicleRespawnDelay" , SetVehicleRespawnDelay);
8585 CLuaCFunctions::AddFunction (" setVehicleIdleRespawnDelay" , SetVehicleIdleRespawnDelay);
8686 CLuaCFunctions::AddFunction (" setVehicleRespawnPosition" , SetVehicleRespawnPosition);
87+ CLuaCFunctions::AddFunction (" setVehicleRespawnRotation" , SetVehicleRespawnRotation);
8788 CLuaCFunctions::AddFunction (" getVehicleRespawnPosition" , GetVehicleRespawnPosition);
8889 CLuaCFunctions::AddFunction (" getVehicleRespawnRotation" , GetVehicleRespawnRotation);
8990 CLuaCFunctions::AddFunction (" respawnVehicle" , RespawnVehicle);
@@ -186,6 +187,8 @@ void CLuaVehicleDefs::AddClass(lua_State* luaVM)
186187 lua_classfunction (luaVM, " getWheelStates" , " getVehicleWheelStates" );
187188 lua_classfunction (luaVM, " getDoorOpenRatio" , " getVehicleDoorOpenRatio" );
188189 lua_classfunction (luaVM, " getHandling" , " getVehicleHandling" );
190+ lua_classfunction (luaVM, " getRespawnPosition" , " getVehicleRespawnPosition" );
191+ lua_classfunction (luaVM, " getRespawnRotation" , " getVehicleRespawnRotation" );
189192
190193 lua_classfunction (luaVM, " setColor" , " setVehicleColor" );
191194 lua_classfunction (luaVM, " setDamageProof" , " setVehicleDamageProof" );
@@ -202,6 +205,7 @@ void CLuaVehicleDefs::AddClass(lua_State* luaVM)
202205 lua_classfunction (luaVM, " setPanelState" , " setVehiclePanelState" );
203206 lua_classfunction (luaVM, " setRespawnDelay" , " setVehicleRespawnDelay" );
204207 lua_classfunction (luaVM, " setRespawnPosition" , " setVehicleRespawnPosition" );
208+ lua_classfunction (luaVM, " setRespawnRotation" , " setVehicleRespawnRotation" );
205209 lua_classfunction (luaVM, " setSirensOn" , " setVehicleSirensOn" );
206210 lua_classfunction (luaVM, " setTurretPosition" , " setVehicleTurretPosition" );
207211 lua_classfunction (luaVM, " setDoorOpenRatio" , " setVehicleDoorOpenRatio" );
@@ -251,7 +255,7 @@ void CLuaVehicleDefs::AddClass(lua_State* luaVM)
251255 lua_classvariable (luaVM, " idleRespawnDelay" , " setVehicleIdleRespawnDelay" , NULL );
252256 lua_classvariable (luaVM, " respawnDelay" , " setVehicleRespawnDelay" , NULL );
253257 lua_classvariable (luaVM, " respawnPosition" , " setVehicleRespawnPosition" , " getVehicleRespawnPosition" , SetVehicleRespawnPosition, OOP_GetVehicleRespawnPosition);
254- lua_classvariable (luaVM, " respawnRotation" , NULL , " getVehicleRespawnRotation" , NULL , OOP_GetVehicleRespawnRotation);
258+ lua_classvariable (luaVM, " respawnRotation" , " setVehicleRespawnRotation " , " getVehicleRespawnRotation" , SetVehicleRespawnRotation , OOP_GetVehicleRespawnRotation);
255259 lua_classvariable (luaVM, " onGround" , NULL , " isVehicleOnGround" );
256260 lua_classvariable (luaVM, " name" , NULL , " getVehicleName" );
257261 lua_classvariable (luaVM, " vehicleType" , NULL , " getVehicleType" );
@@ -2326,20 +2330,42 @@ int CLuaVehicleDefs::GetVehicleRespawnPosition(lua_State* luaVM)
23262330 return 1 ;
23272331}
23282332
2333+ int CLuaVehicleDefs::SetVehicleRespawnRotation (lua_State* luaVM)
2334+ {
2335+ CElement* pElement;
2336+ CVector vecRotation;
2337+
2338+ CScriptArgReader argStream (luaVM);
2339+ argStream.ReadUserData (pElement);
2340+ argStream.ReadVector3D (vecRotation, CVector ());
2341+
2342+ if (!argStream.HasErrors ())
2343+ {
2344+ if (CStaticFunctionDefinitions::SetVehicleRespawnRotation (pElement, vecRotation))
2345+ {
2346+ lua_pushboolean (luaVM, true );
2347+ return 1 ;
2348+ }
2349+ }
2350+ else
2351+ m_pScriptDebugging->LogCustom (luaVM, argStream.GetFullErrorMessage ());
2352+
2353+ lua_pushboolean (luaVM, false );
2354+ return 1 ;
2355+ }
2356+
23292357int CLuaVehicleDefs::SetVehicleRespawnPosition (lua_State* luaVM)
23302358{
23312359 CElement* pElement;
23322360 CVector vecPosition;
2333- CVector vecRotation;
23342361
23352362 CScriptArgReader argStream (luaVM);
23362363 argStream.ReadUserData (pElement);
23372364 argStream.ReadVector3D (vecPosition);
2338- argStream.ReadVector3D (vecRotation, CVector ());
23392365
23402366 if (!argStream.HasErrors ())
23412367 {
2342- if (CStaticFunctionDefinitions::SetVehicleRespawnPosition (pElement, vecPosition, vecRotation ))
2368+ if (CStaticFunctionDefinitions::SetVehicleRespawnPosition (pElement, vecPosition))
23432369 {
23442370 lua_pushboolean (luaVM, true );
23452371 return 1 ;
0 commit comments