aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts
diff options
context:
space:
mode:
authorZanieon <william-millennium@hotmail.com>2024-08-30 15:12:42 +0200
committerZanieon <william-millennium@hotmail.com>2024-08-30 15:12:42 +0200
commit8b34689dca9f2392ad74c57a19e64ec58abda69e (patch)
treec3e0d71e5b44ec8331a4f17b4d4094a66e3eb185 /Northstar.CustomServers/mod/scripts/vscripts
parentbd77a936a90f4b30c5e88b5fa26e4d995930d9ff (diff)
downloadNorthstarMods-8b34689dca9f2392ad74c57a19e64ec58abda69e.tar.gz
NorthstarMods-8b34689dca9f2392ad74c57a19e64ec58abda69e.zip
Move `OnPlayerKilled` function
as part of the refactoring effort in #830
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut26
1 files changed, 13 insertions, 13 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut
index e1c179b5..752aa907 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ctf.nut
@@ -91,19 +91,6 @@ bool function VerifyCTFSpawnpoint( entity spawnpoint, int team )
return true
}
-void function OnPlayerKilled( entity victim, entity attacker, var damageInfo )
-{
- if ( !IsValid( GetFlagForTeam( GetOtherTeam( victim.GetTeam() ) ) ) ) // getting a crash idk
- return
- if ( GetFlagForTeam( GetOtherTeam( victim.GetTeam() ) ).GetParent() == victim )
- {
- if ( victim != attacker && attacker.IsPlayer() )
- AddPlayerScore( attacker, "FlagCarrierKill", victim )
-
- DropFlag( victim )
- }
-}
-
void function CreateFlags()
{
if ( IsValid( file.imcFlagSpawn ) )
@@ -236,6 +223,19 @@ void function CTFInitPlayer( entity player )
Remote_CallFunction_NonReplay( player, "ServerCallback_SetFlagHomeOrigin", TEAM_MILITIA, militiaSpawn.x, militiaSpawn.y, militiaSpawn.z )
}
+void function OnPlayerKilled( entity victim, entity attacker, var damageInfo )
+{
+ if ( !IsValid( GetFlagForTeam( GetOtherTeam( victim.GetTeam() ) ) ) ) // getting a crash idk
+ return
+ if ( GetFlagForTeam( GetOtherTeam( victim.GetTeam() ) ).GetParent() == victim )
+ {
+ if ( victim != attacker && attacker.IsPlayer() )
+ AddPlayerScore( attacker, "FlagCarrierKill", victim )
+
+ DropFlag( victim )
+ }
+}
+
void function TrackFlagReturnTrigger( entity flag, entity returnTrigger )
{
// this is a bit of a hack, it seems parenting the return trigger to the flag actually sets the pickup radius of the flag to be the same as the trigger