@@ -2303,24 +2303,38 @@ int CLuaVehicleDefs::GetVehicleRespawnRotation(lua_State* luaVM)
2303
2303
return 1 ;
2304
2304
}
2305
2305
2306
- int CLuaVehicleDefs::GetVehicleRespawnPosition (lua_State* luaVM)
2306
+ int CLuaVehicleDefs::SetVehicleRespawnPosition (lua_State* luaVM)
2307
2307
{
2308
- // float, float, float getVehicleRespawnPosition( vehicle theVehicle )
2309
- CElement* pElement = NULL ;
2308
+ CElement* pElement;
2309
+ CVector vecPosition ;
2310
2310
2311
2311
CScriptArgReader argStream (luaVM);
2312
2312
argStream.ReadUserData (pElement);
2313
+ argStream.ReadVector3D (vecPosition);
2313
2314
2314
- if (! argStream.HasErrors ())
2315
+ if (argStream.NextIsVector3D ())
2315
2316
{
2316
- CVector vecPosition;
2317
- if (CStaticFunctionDefinitions::GetVehicleRespawnPosition (pElement, vecPosition))
2318
- {
2319
- lua_pushnumber (luaVM, vecPosition.fX );
2320
- lua_pushnumber (luaVM, vecPosition.fY );
2321
- lua_pushnumber (luaVM, vecPosition.fZ );
2317
+ CVector vecRotation;
2318
+ argStream.ReadVector3D (vecRotation);
2322
2319
2323
- return 3 ;
2320
+ if (!argStream.HasErrors ())
2321
+ {
2322
+ if (CStaticFunctionDefinitions::SetVehicleRespawnPosition (pElement, vecPosition) &&
2323
+ CStaticFunctionDefinitions::SetVehicleRespawnRotation (pElement, vecRotation))
2324
+ {
2325
+ lua_pushboolean (luaVM, true );
2326
+ return 1 ;
2327
+ }
2328
+ }
2329
+ else
2330
+ m_pScriptDebugging->LogCustom (luaVM, argStream.GetFullErrorMessage ());
2331
+ }
2332
+ else if (!argStream.HasErrors ())
2333
+ {
2334
+ if (CStaticFunctionDefinitions::SetVehicleRespawnPosition (pElement, vecPosition))
2335
+ {
2336
+ lua_pushboolean (luaVM, true );
2337
+ return 1 ;
2324
2338
}
2325
2339
}
2326
2340
else
@@ -2330,21 +2344,24 @@ int CLuaVehicleDefs::GetVehicleRespawnPosition(lua_State* luaVM)
2330
2344
return 1 ;
2331
2345
}
2332
2346
2333
- int CLuaVehicleDefs::SetVehicleRespawnRotation (lua_State* luaVM)
2347
+ int CLuaVehicleDefs::GetVehicleRespawnPosition (lua_State* luaVM)
2334
2348
{
2335
- CElement* pElement;
2336
- CVector vecRotation ;
2349
+ // float, float, float getVehicleRespawnPosition( vehicle theVehicle )
2350
+ CElement* pElement = NULL ;
2337
2351
2338
2352
CScriptArgReader argStream (luaVM);
2339
2353
argStream.ReadUserData (pElement);
2340
- argStream.ReadVector3D (vecRotation, CVector ());
2341
2354
2342
2355
if (!argStream.HasErrors ())
2343
2356
{
2344
- if (CStaticFunctionDefinitions::SetVehicleRespawnRotation (pElement, vecRotation))
2357
+ CVector vecPosition;
2358
+ if (CStaticFunctionDefinitions::GetVehicleRespawnPosition (pElement, vecPosition))
2345
2359
{
2346
- lua_pushboolean (luaVM, true );
2347
- return 1 ;
2360
+ lua_pushnumber (luaVM, vecPosition.fX );
2361
+ lua_pushnumber (luaVM, vecPosition.fY );
2362
+ lua_pushnumber (luaVM, vecPosition.fZ );
2363
+
2364
+ return 3 ;
2348
2365
}
2349
2366
}
2350
2367
else
@@ -2354,35 +2371,18 @@ int CLuaVehicleDefs::SetVehicleRespawnRotation(lua_State* luaVM)
2354
2371
return 1 ;
2355
2372
}
2356
2373
2357
- int CLuaVehicleDefs::SetVehicleRespawnPosition (lua_State* luaVM)
2374
+ int CLuaVehicleDefs::SetVehicleRespawnRotation (lua_State* luaVM)
2358
2375
{
2359
2376
CElement* pElement;
2360
- CVector vecPosition ;
2377
+ CVector vecRotation ;
2361
2378
2362
2379
CScriptArgReader argStream (luaVM);
2363
2380
argStream.ReadUserData (pElement);
2364
- argStream.ReadVector3D (vecPosition);
2365
-
2366
- if (argStream.NextIsVector3D ())
2367
- {
2368
- CVector vecRotation;
2369
- argStream.ReadVector3D (vecRotation);
2381
+ argStream.ReadVector3D (vecRotation, CVector ());
2370
2382
2371
- if (!argStream.HasErrors ())
2372
- {
2373
- if (CStaticFunctionDefinitions::SetVehicleRespawnPosition (pElement, vecPosition) &&
2374
- CStaticFunctionDefinitions::SetVehicleRespawnRotation (pElement, vecRotation))
2375
- {
2376
- lua_pushboolean (luaVM, true );
2377
- return 1 ;
2378
- }
2379
- }
2380
- else
2381
- m_pScriptDebugging->LogCustom (luaVM, argStream.GetFullErrorMessage ());
2382
- }
2383
- else if (!argStream.HasErrors ())
2383
+ if (!argStream.HasErrors ())
2384
2384
{
2385
- if (CStaticFunctionDefinitions::SetVehicleRespawnPosition (pElement, vecPosition ))
2385
+ if (CStaticFunctionDefinitions::SetVehicleRespawnRotation (pElement, vecRotation ))
2386
2386
{
2387
2387
lua_pushboolean (luaVM, true );
2388
2388
return 1 ;
0 commit comments