aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/evac
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-07 03:53:07 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-07 03:53:07 +0000
commit35dfd937798d105238db23ea86f90f21be46694b (patch)
treed0e1ee639bc6177649dbcbde054f1e6094fc054c /Northstar.CustomServers/mod/scripts/vscripts/evac
parente79a58640e1ef1ea1c3c954aefccd36c3cb55286 (diff)
downloadNorthstarMods-35dfd937798d105238db23ea86f90f21be46694b.tar.gz
NorthstarMods-35dfd937798d105238db23ea86f90f21be46694b.zip
code cleanup, xp, postgame and some small changes
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/evac')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut21
1 files changed, 14 insertions, 7 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut b/Northstar.CustomServers/mod/scripts/vscripts/evac/_evac.gnut
index c0242cc19..712fa9de2 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