Skip to content

Commit ea24f89

Browse files
committed
added rotation to setVehicleRespawnPosition
1 parent 86f0cb6 commit ea24f89

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2363,7 +2363,24 @@ int CLuaVehicleDefs::SetVehicleRespawnPosition(lua_State* luaVM)
23632363
argStream.ReadUserData(pElement);
23642364
argStream.ReadVector3D(vecPosition);
23652365

2366-
if (!argStream.HasErrors())
2366+
if (argStream.NextIsVector3D())
2367+
{
2368+
CVector vecRotation;
2369+
argStream.ReadVector3D(vecRotation);
2370+
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())
23672384
{
23682385
if (CStaticFunctionDefinitions::SetVehicleRespawnPosition(pElement, vecPosition))
23692386
{

0 commit comments

Comments
 (0)