From 35dfd937798d105238db23ea86f90f21be46694b Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Sun, 7 Nov 2021 03:53:07 +0000 Subject: code cleanup, xp, postgame and some small changes --- .../mod/scripts/vscripts/evac/_evac.gnut | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/evac') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut b/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut index c0242cc1..712fa9de 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut @@ -87,12 +87,17 @@ bool function IsEvacDropship( entity ent ) // evac epilogue void function EvacEpilogueSetup() { + // don't do much here because other scripts should be able to call evac stuff themselves AddCallback_GameStateEnter( eGameState.Epilogue, EvacEpilogue ) } void function EvacEpilogue() { - thread Evac( GetPlayerArray()[0].GetTeam(), EVAC_INITIAL_WAIT, EVAC_ARRIVAL_TIME, EVAC_WAIT_TIME, EvacEpiloguePlayerCanBoard, EvacEpilogueShouldLeaveEarly, EvacEpilogueCompleted ) + // make sure we don't run this on ffa modes if no epilogue was specified, since evac is default epilogue + if ( GetCurrentPlaylistVarInt( "max_teams", 2 ) == 2 ) + thread Evac( GetPlayerArray()[0].GetTeam(), 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 } bool function EvacEpiloguePlayerCanBoard( entity dropship, entity player ) @@ -123,14 +128,16 @@ bool function EvacEpilogueShouldLeaveEarly( entity dropship ) void function EvacEpilogueCompleted( entity dropship ) { wait 5.0 - print( dropship ) - foreach ( entity player in dropship.s.evacSlots ) + if ( IsValid( dropship ) ) { - if ( !IsValid( player ) ) - continue - - ScreenFadeToBlackForever( player, 2.0 ) + foreach ( entity player in dropship.s.evacSlots ) + { + if ( !IsValid( player ) ) + continue + + ScreenFadeToBlackForever( player, 2.0 ) + } } wait 2.0 -- cgit v1.2.3