aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/mod/scripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut25
1 files changed, 9 insertions, 16 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut
index 5746fe77..11cb30d6 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut
@@ -602,29 +602,22 @@ void function TrackChevronStates()
while ( true )
{
- int imcChevron
- int militiaChevron
+ table <int, int> chevrons = {
+ [TEAM_IMC] = 0,
+ [TEAM_MILITIA] = 0,
+ }
foreach ( HardpointStruct hardpoint in file.hardpoints )
{
- if ( hardpoint.hardpoint.GetTeam() == TEAM_IMC )
- {
- if ( hardpoint.hardpoint.GetHardpointState() == CAPTURE_POINT_STATE_AMPED )
- imcChevron += 4
- else
- imcChevron++
- }
- else if ( hardpoint.hardpoint.GetTeam() == TEAM_MILITIA )
+ foreach ( k, v in chevrons )
{
- if ( hardpoint.hardpoint.GetHardpointState() == CAPTURE_POINT_STATE_AMPED )
- militiaChevron += 4
- else
- militiaChevron++
+ if ( k == hardpoint.hardpoint.GetTeam() )
+ chevrons[k] += ( hardpoint.hardpoint.GetHardpointState() == CAPTURE_POINT_STATE_AMPED ) ? 4 : 1
}
}
- SetGlobalNetInt( "imcChevronState", imcChevron )
- SetGlobalNetInt( "milChevronState", militiaChevron )
+ SetGlobalNetInt( "imcChevronState", chevrons[TEAM_IMC] )
+ SetGlobalNetInt( "milChevronState", chevrons[TEAM_MILITIA] )
WaitFrame()
}