aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod
diff options
context:
space:
mode:
authorMaya <malte.hoermeyer@web.de>2022-03-29 00:53:06 +0200
committerGitHub <noreply@github.com>2022-03-29 00:53:06 +0200
commit464825cb304b070fb0d497f47a3e8a8d831d5248 (patch)
treec99d53239223fc5bdcb023aa3e443a0e4fba8a72 /Northstar.CustomServers/mod
parent4e308f4682812b8db309b4c97b9ac426fcfa90f7 (diff)
downloadNorthstarMods-464825cb304b070fb0d497f47a3e8a8d831d5248.tar.gz
NorthstarMods-464825cb304b070fb0d497f47a3e8a8d831d5248.zip
Fix Game Crash when player not in capperArray (#279)v1.6.1-rc1v1.6.1v1.6.0-rc5v1.6.0
Diffstat (limited to 'Northstar.CustomServers/mod')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut12
1 files changed, 6 insertions, 6 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut
index 74e6b58c..705b7836 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut
@@ -150,8 +150,8 @@ void function GamemodeCP_OnPlayerKilled(entity victim, entity attacker, var dama
void function removePlayerFromCapperArray_threaded(array<entity> capperArray,entity player)
{
WaitFrame()
- if(capperArray.contains(player))
- capperArray.remove(capperArray.find(player))
+ FindAndRemove(capperArray,player)
+
}
void function RateSpawnpoints_CP( int checkClass, array<entity> spawnpoints, int team, entity player )
@@ -589,12 +589,12 @@ void function HardpointThink( HardpointStruct hardpoint )
foreach(entity player in hardpoint.imcCappers)
{
if(DistanceSqr(player.GetOrigin(),hardpointEnt.GetOrigin())>1200000)
- hardpoint.imcCappers.remove(hardpoint.imcCappers.find(player))
+ FindAndRemove(hardpoint.imcCappers,player)
}
foreach(entity player in hardpoint.militiaCappers)
{
if(DistanceSqr(player.GetOrigin(),hardpointEnt.GetOrigin())>1200000)
- hardpoint.militiaCappers.remove(hardpoint.militiaCappers.find(player))
+ FindAndRemove(hardpoint.militiaCappers,player)
}
@@ -656,7 +656,7 @@ void function OnHardpointLeft( entity trigger, entity player )
hardpoint = hardpointStruct
if ( player.GetTeam() == TEAM_IMC )
- hardpoint.imcCappers.remove( hardpoint.imcCappers.find( player ) )
+ FindAndRemove( hardpoint.imcCappers, player )
else
FindAndRemove( hardpoint.militiaCappers, player )
foreach(CP_PlayerStruct playerStruct in file.players)
@@ -702,4 +702,4 @@ string function GetHardpointGroup(entity hardpoint) //Hardpoint Entity B on Home
return "B"
return string(hardpoint.kv.hardpointGroup)
-} \ No newline at end of file
+}