@@ -171,7 +171,7 @@ void CLuaVehicleDefs::AddClass ( lua_State* luaVM )
171171 lua_classfunction ( luaVM, " areSirensOn" , " getVehicleSirensOn" );
172172 lua_classfunction ( luaVM, " getTowedByVehicle" , " getVehicleTowedByVehicle" );
173173 lua_classfunction ( luaVM, " getTowingVehicle" , " getVehicleTowingVehicle" );
174- lua_classfunction ( luaVM, " getTurnVelocity" , " getVehicleTurnVelocity" );
174+ lua_classfunction ( luaVM, " getTurnVelocity" , " getVehicleTurnVelocity" , CLuaVehicleDefs::OOP_GetVehicleTurnVelocity );
175175 lua_classfunction ( luaVM, " getTurretPosition" , " getVehicleTurretPosition" );
176176 lua_classfunction ( luaVM, " getVehicleType" , " getVehicleType" ); // This isn't "getType" because it would overwrite Element.getType
177177 lua_classfunction ( luaVM, " getUpgradeOnSlot" , " getVehicleUpgradeOnSlot" );
@@ -235,7 +235,7 @@ void CLuaVehicleDefs::AddClass ( lua_State* luaVM )
235235 lua_classvariable ( luaVM, " maxPassengers" , NULL , " getVehicleMaxPassengers" );
236236 lua_classvariable ( luaVM, " upgrades" , NULL , " getVehicleUpgrades" );
237237 lua_classvariable ( luaVM, " turretPosition" , " setVehicleTurretPosition" , " getVehicleTurretPosition" );
238- lua_classvariable ( luaVM, " turnVelocity" , " setVehicleTurnVelocity" , " getVehicleTurnVelocity" );
238+ lua_classvariable ( luaVM, " turnVelocity" , " setVehicleTurnVelocity" , " getVehicleTurnVelocity" , SetVehicleTurnVelocity, OOP_GetVehicleTurnVelocity );
239239 lua_classvariable ( luaVM, " overrideLights" , " setVehicleOverrideLights" , " getVehicleOverrideLights" );
240240 lua_classvariable ( luaVM, " idleRespawnDelay" , " setVehicleIdleRespawnDelay" , NULL );
241241 lua_classvariable ( luaVM, " respawnDelay" , " setVehicleRespawnDelay" , NULL );
@@ -1039,6 +1039,30 @@ int CLuaVehicleDefs::GetVehicleTurnVelocity ( lua_State* luaVM )
10391039}
10401040
10411041
1042+ int CLuaVehicleDefs::OOP_GetVehicleTurnVelocity ( lua_State* luaVM )
1043+ {
1044+ CVehicle* pVehicle;
1045+
1046+ CScriptArgReader argStream ( luaVM );
1047+ argStream.ReadUserData ( pVehicle );
1048+
1049+ if ( !argStream.HasErrors () )
1050+ {
1051+ CVector vecTurnVelocity;
1052+ if ( CStaticFunctionDefinitions::GetVehicleTurnVelocity ( pVehicle, vecTurnVelocity ) )
1053+ {
1054+ lua_pushvector ( luaVM, vecTurnVelocity );
1055+ return 1 ;
1056+ }
1057+ }
1058+ else
1059+ m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
1060+
1061+ lua_pushboolean ( luaVM, false );
1062+ return 1 ;
1063+ }
1064+
1065+
10421066int CLuaVehicleDefs::GetVehicleTurretPosition ( lua_State* luaVM )
10431067{
10441068 CVehicle* pVehicle;
0 commit comments