Skip to content

Commit

Permalink
Move CTFInitPlayer function
Browse files Browse the repository at this point in the history
as part of the refactoring effort in #830
  • Loading branch information
Zanieon committed Aug 30, 2024
1 parent dafc1d1 commit bd77a93
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,6 @@ bool function VerifyCTFSpawnpoint( entity spawnpoint, int team )
return true
}

void function CTFInitPlayer( entity player )
{
if ( !IsValid( file.imcFlagSpawn ) )
return

vector imcSpawn = file.imcFlagSpawn.GetOrigin()
Remote_CallFunction_NonReplay( player, "ServerCallback_SetFlagHomeOrigin", TEAM_IMC, imcSpawn.x, imcSpawn.y, imcSpawn.z )

vector militiaSpawn = file.militiaFlagSpawn.GetOrigin()
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
Expand Down Expand Up @@ -236,6 +224,18 @@ void function RemoveFlags()
SetFlagStateForTeam( TEAM_IMC, eFlagState.None )
}

void function CTFInitPlayer( entity player )
{
if ( !IsValid( file.imcFlagSpawn ) )
return

vector imcSpawn = file.imcFlagSpawn.GetOrigin()
Remote_CallFunction_NonReplay( player, "ServerCallback_SetFlagHomeOrigin", TEAM_IMC, imcSpawn.x, imcSpawn.y, imcSpawn.z )

vector militiaSpawn = file.militiaFlagSpawn.GetOrigin()
Remote_CallFunction_NonReplay( player, "ServerCallback_SetFlagHomeOrigin", TEAM_MILITIA, militiaSpawn.x, militiaSpawn.y, militiaSpawn.z )
}

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
Expand Down

0 comments on commit bd77a93

Please sign in to comment.