Skip to content

Commit

Permalink
Move SetFlagStateForTeam to end of file
Browse files Browse the repository at this point in the history
in an effort to have all related functions close to each other
  • Loading branch information
Zanieon committed Aug 30, 2024
1 parent 6cd957e commit 3eb15ee
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,6 @@ void function TrackFlagReturnTrigger( entity flag, entity returnTrigger )
}
}

void function SetFlagStateForTeam( int team, int state )
{
if ( state == eFlagState.Away ) // we tell the client the flag is the player carrying it if they're carrying it
SetGlobalNetEnt( team == TEAM_IMC ? "imcFlag" : "milFlag", ( team == TEAM_IMC ? file.imcFlag : file.militiaFlag ).GetParent() )
else
SetGlobalNetEnt( team == TEAM_IMC ? "imcFlag" : "milFlag", team == TEAM_IMC ? file.imcFlag : file.militiaFlag )

SetGlobalNetInt( team == TEAM_IMC ? "imcFlagState" : "milFlagState", state )
}

bool function OnFlagCollected( entity player, entity flag )
{
Expand Down Expand Up @@ -524,4 +515,14 @@ void function TryReturnFlag( entity player, entity flag )
MessageToTeam( GetOtherTeam( flag.GetTeam() ), eEventNotifications.PlayerReturnedEnemyFlag, null, player )
EmitSoundOnEntityToTeam( flag, "UI_CTF_3P_EnemyReturnsFlag", GetOtherTeam( flag.GetTeam() ) )
PlayFactionDialogueToTeam( "ctf_flagReturnedEnemy", GetOtherTeam( flag.GetTeam() ) )
}
}

void function SetFlagStateForTeam( int team, int state )
{
if ( state == eFlagState.Away ) // we tell the client the flag is the player carrying it if they're carrying it
SetGlobalNetEnt( team == TEAM_IMC ? "imcFlag" : "milFlag", ( team == TEAM_IMC ? file.imcFlag : file.militiaFlag ).GetParent() )
else
SetGlobalNetEnt( team == TEAM_IMC ? "imcFlag" : "milFlag", team == TEAM_IMC ? file.imcFlag : file.militiaFlag )

SetGlobalNetInt( team == TEAM_IMC ? "imcFlagState" : "milFlagState", state )
}

0 comments on commit 3eb15ee

Please sign in to comment.