aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom/mod/scripts
diff options
context:
space:
mode:
authorSoup-64 <43444191+Soup-64@users.noreply.github.com>2021-12-30 16:15:08 -0500
committerGitHub <noreply@github.com>2021-12-30 16:15:08 -0500
commitdcdd4abb1408e5a55c8048193d246a7f9da646b3 (patch)
tree6e247a7cc3f93b7719d6874d54d6e37fed1516d4 /Northstar.Custom/mod/scripts
parentaed2841ebbecb6376f00bf190503ce5c694f9fa4 (diff)
downloadNorthstarMods-dcdd4abb1408e5a55c8048193d246a7f9da646b3.tar.gz
NorthstarMods-dcdd4abb1408e5a55c8048193d246a7f9da646b3.zip
fix end of game replay perspective and repsawns during replays
properly sets the end of game replay to use the appropriate player, and prevents respawns during end of game replays
Diffstat (limited to 'Northstar.Custom/mod/scripts')
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut23
1 files changed, 17 insertions, 6 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut
index a0e0b743..2ccd46ba 100644
--- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut
+++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut
@@ -30,7 +30,7 @@ void function InfectionInitPlayer( entity player )
if ( GetGameState() < eGameState.Playing )
SetTeam( player, INFECTION_TEAM_SURVIVOR )
else
- InfectPlayer( player )
+ InfectPlayer( player, player )
}
void function SelectFirstInfected()
@@ -45,23 +45,23 @@ void function SelectFirstInfectedDelayed()
array<entity> players = GetPlayerArray()
entity infected = players[ RandomInt( players.len() ) ]
- InfectPlayer( infected )
+ InfectPlayer( infected, infected )
RespawnInfected( infected )
}
void function InfectionOnPlayerKilled( entity victim, entity attacker, var damageInfo )
{
- if ( !victim.IsPlayer() || GetGameState() != eGameState.Playing )
+ if ( !victim.IsPlayer() || !attacker.IsPlayer() || GetGameState() != eGameState.Playing )
return
if ( victim.GetTeam() == INFECTION_TEAM_SURVIVOR )
- InfectPlayer( victim )
+ InfectPlayer( victim, attacker )
if ( attacker.IsPlayer() )
attacker.SetPlayerGameStat( PGS_ASSAULT_SCORE, attacker.GetPlayerGameStat( PGS_ASSAULT_SCORE ) + 1 )
}
-void function InfectPlayer( entity player )
+void function InfectPlayer( entity player, entity attacker )
{
SetTeam( player, INFECTION_TEAM_INFECTED )
player.SetPlayerGameStat( PGS_ASSAULT_SCORE, 0 ) // reset kills
@@ -70,7 +70,12 @@ void function InfectPlayer( entity player )
// check how many survivors there are
array<entity> survivors = GetPlayerArrayOfTeam( INFECTION_TEAM_SURVIVOR )
if ( survivors.len() == 0 )
+ {
+ SetRespawnsEnabled( false )
+ SetKillcamsEnabled( false )
+ SetRoundWinningKillReplayAttacker(attacker)
SetWinner( INFECTION_TEAM_INFECTED )
+ }
else if ( survivors.len() == 1 && !file.hasHadLastInfection )
SetLastSurvivor( survivors[ 0 ] )
@@ -183,8 +188,14 @@ void function SetLastSurvivor( entity player )
int function TimeoutCheckSurvivors()
{
- if ( GetPlayerArrayOfTeam( INFECTION_TEAM_SURVIVOR ).len() > 0 )
+ array<entity> survivors = GetPlayerArrayOfTeam( INFECTION_TEAM_SURVIVOR )
+ if ( survivors.len() > 0 )
+ {
+ SetRespawnsEnabled( false )
+ SetKillcamsEnabled( false )
+ SetRoundWinningKillReplayAttacker(survivors[ 0 ])
return INFECTION_TEAM_SURVIVOR
+ }
return INFECTION_TEAM_INFECTED
}