From db06ea056bc0fd5e63813db7798a453a0bdce64a Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 14 Jun 2018 19:29:34 +0200 Subject: [PATCH] Remove useles havocbot_role_flags field --- qcsrc/common/gamemodes/gamemode/assault/assault.qc | 2 -- qcsrc/common/gamemodes/gamemode/assault/assault.qh | 1 - .../gamemodes/gamemode/onslaught/sv_onslaught.qc | 13 ++++--------- .../gamemodes/gamemode/onslaught/sv_onslaught.qh | 1 - 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/assault/assault.qc b/qcsrc/common/gamemodes/gamemode/assault/assault.qc index a05ab40e6..1a9fff10c 100644 --- a/qcsrc/common/gamemodes/gamemode/assault/assault.qc +++ b/qcsrc/common/gamemodes/gamemode/assault/assault.qc @@ -523,12 +523,10 @@ void havocbot_role_ast_setrole(entity this, float role) { case HAVOCBOT_AST_ROLE_DEFENSE: this.havocbot_role = havocbot_role_ast_defense; - this.havocbot_role_flags = HAVOCBOT_AST_ROLE_DEFENSE; this.havocbot_role_timeout = 0; break; case HAVOCBOT_AST_ROLE_OFFENSE: this.havocbot_role = havocbot_role_ast_offense; - this.havocbot_role_flags = HAVOCBOT_AST_ROLE_OFFENSE; this.havocbot_role_timeout = 0; break; } diff --git a/qcsrc/common/gamemodes/gamemode/assault/assault.qh b/qcsrc/common/gamemodes/gamemode/assault/assault.qh index d949f18b3..ff65b66ed 100644 --- a/qcsrc/common/gamemodes/gamemode/assault/assault.qh +++ b/qcsrc/common/gamemodes/gamemode/assault/assault.qh @@ -32,7 +32,6 @@ const int HAVOCBOT_AST_ROLE_NONE = 0; const int HAVOCBOT_AST_ROLE_DEFENSE = 2; const int HAVOCBOT_AST_ROLE_OFFENSE = 4; -.int havocbot_role_flags; .float havocbot_attack_time; void(entity this) havocbot_role_ast_defense; diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc index 4caf054e0..f5095bce4 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc @@ -1260,29 +1260,24 @@ void havocbot_goalrating_ons_offenseitems(entity this, float ratingscale, vector void havocbot_role_ons_setrole(entity this, int role) { - LOG_DEBUG(this.netname," switched to "); switch(role) { case HAVOCBOT_ONS_ROLE_DEFENSE: - LOG_DEBUG("defense"); + LOG_DEBUG(this.netname, " switched to defense"); this.havocbot_role = havocbot_role_ons_defense; - this.havocbot_role_flags = HAVOCBOT_ONS_ROLE_DEFENSE; this.havocbot_role_timeout = 0; break; case HAVOCBOT_ONS_ROLE_ASSISTANT: - LOG_DEBUG("assistant"); + LOG_DEBUG(this.netname, " switched to assistant"); this.havocbot_role = havocbot_role_ons_assistant; - this.havocbot_role_flags = HAVOCBOT_ONS_ROLE_ASSISTANT; this.havocbot_role_timeout = 0; break; case HAVOCBOT_ONS_ROLE_OFFENSE: - LOG_DEBUG("offense"); + LOG_DEBUG(this.netname, " switched to offense"); this.havocbot_role = havocbot_role_ons_offense; - this.havocbot_role_flags = HAVOCBOT_ONS_ROLE_OFFENSE; this.havocbot_role_timeout = 0; break; } - LOG_DEBUG(""); } void havocbot_goalrating_ons_controlpoints_attack(entity this, float ratingscale) @@ -1309,7 +1304,7 @@ void havocbot_goalrating_ons_controlpoints_attack(entity this, float ratingscale // (easier and cleaner than keeping counters per cp and teams) FOREACH_CLIENT(it != this && IS_PLAYER(it), { if(SAME_TEAM(it, this)) - if(it.havocbot_role_flags & HAVOCBOT_ONS_ROLE_OFFENSE) + if(it.havocbot_role == havocbot_role_ons_offense) if(it.havocbot_ons_target == cp2) ++c; }); diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qh b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qh index 5c7fd4697..7a9b192a5 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qh +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qh @@ -80,7 +80,6 @@ const int HAVOCBOT_ONS_ROLE_OFFENSE = 8; .entity havocbot_ons_target; -.int havocbot_role_flags; .float havocbot_attack_time; void havocbot_role_ons_defense(entity this); -- 2.39.2