diff options
author | Soup-64 <43444191+Soup-64@users.noreply.github.com> | 2021-12-29 19:39:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-29 19:39:06 -0500 |
commit | a109a2d376f61fb92bf9bedffe67713316bcdfae (patch) | |
tree | 73087865570f8dc53eeb3d7ea19c4878dc376b6c /Northstar.CustomServers | |
parent | e8f67265e817bdca167fbb9970327588501be580 (diff) | |
download | NorthstarMods-a109a2d376f61fb92bf9bedffe67713316bcdfae.tar.gz NorthstarMods-a109a2d376f61fb92bf9bedffe67713316bcdfae.zip |
Fix missing respawn grace during EvacEpilogue and Postmatch gamestate
Adds in a helper function on top of setting respawn behaviour for adding a grace period before disabling the respawn to fix #30. This also disables respawns during the Postmatch game state, and grace length is controlled by the GAME_EPILOGUE_PLAYER_RESPAWN_LEEWAY constant.
Diffstat (limited to 'Northstar.CustomServers')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut b/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut index a4f23b85..b861ed9f 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut @@ -103,11 +103,20 @@ void function EvacEpilogue() if ( canRunEvac ) { - SetRespawnsEnabled( false ) + thread SetRespawnAndWait( false ) thread Evac( GetOtherTeam( winner ), EVAC_INITIAL_WAIT, EVAC_ARRIVAL_TIME, EVAC_WAIT_TIME, EvacEpiloguePlayerCanBoard, EvacEpilogueShouldLeaveEarly, EvacEpilogueCompleted ) } else - thread EvacEpilogueCompleted( null ) // this is hacky but like, this also shouldn't really be hit in normal gameplay + { + thread SetRespawnAndWait( false ) //prevent respawns during the fade to black, should only be an issue if the match is a draw + thread EvacEpilogueCompleted( null ) //this is hacky but like, this also shouldn't really be hit in normal gameplay + } +} + +void function SetRespawnAndWait(bool mode) +{ + wait GAME_EPILOGUE_PLAYER_RESPAWN_LEEWAY + SetRespawnsEnabled( mode ) } bool function EvacEpiloguePlayerCanBoard( entity dropship, entity player ) @@ -386,4 +395,4 @@ void function EvacDropshipKilled( entity dropship, var damageInfo ) player.Die( DamageInfo_GetAttacker( damageInfo ), DamageInfo_GetWeapon( damageInfo ), { damageSourceId = eDamageSourceId.evac_dropship_explosion, scriptType = DF_GIB } ) } } -}
\ No newline at end of file +} |