diff options
author | RomeoCantCode <romeoloeffel@gmail.com> | 2022-03-29 23:01:11 +0200 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-03-30 00:04:30 +0200 |
commit | 163a77686a40856ccbffdbb7d09f1cf398e24005 (patch) | |
tree | f89c670a5d089c6d06bf22f62452354be9a97eb4 /Northstar.CustomServers/mod | |
parent | 464825cb304b070fb0d497f47a3e8a8d831d5248 (diff) | |
download | NorthstarMods-163a77686a40856ccbffdbb7d09f1cf398e24005.tar.gz NorthstarMods-163a77686a40856ccbffdbb7d09f1cf398e24005.zip |
Fix servercrash because batteryContainer entity is null (#267)
...when respawning as titan
Diffstat (limited to 'Northstar.CustomServers/mod')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut index 8d29c612..5d5742c3 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -484,7 +484,12 @@ void function RespawnAsTitan( entity player, bool manualPosition = false ) player.RespawnPlayer( null ) // spawn player as pilot so they get their pilot loadout on embark player.SetOrigin( titan.GetOrigin() ) - PilotBecomesTitan( player, titan ) // make player titan + // don't make player titan when entity batteryContainer is not valid. + // This will prevent a servercrash that sometimes occur when evac is disabled and somebody is calling a titan in the defeat screen. + if( IsValid( titan.GetTitanSoul().soul.batteryContainer ) ) + PilotBecomesTitan( player, titan ) // make player titan + else + print( "batteryContainer is not a valid entity in RespawnAsTitan(). Skipping PilotBecomesTitan()." ) } |