From: Mario Date: Mon, 13 Apr 2020 12:30:51 +0000 (+1000) Subject: Fix some missing parenthesis in autospec code X-Git-Tag: xonotic-v0.8.5~1114 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8dc72a4c03e5b20e862bc095db90db10ba924a9e;p=xonotic%2Fxonotic-data.pk3dir.git Fix some missing parenthesis in autospec code --- diff --git a/qcsrc/common/mutators/mutator/superspec/sv_superspec.qc b/qcsrc/common/mutators/mutator/superspec/sv_superspec.qc index eb2008235..5fe52b2d5 100644 --- a/qcsrc/common/mutators/mutator/superspec/sv_superspec.qc +++ b/qcsrc/common/mutators/mutator/superspec/sv_superspec.qc @@ -121,16 +121,16 @@ MUTATOR_HOOKFUNCTION(superspec, ItemTouch) } } - if((it.autospec_flags & ASF_SHIELD && item.invincible_finished) || - (it.autospec_flags & ASF_STRENGTH && item.strength_finished) || - (it.autospec_flags & ASF_MEGA_AR && item.itemdef == ITEM_ArmorMega) || - (it.autospec_flags & ASF_MEGA_HP && item.itemdef == ITEM_HealthMega) || - (it.autospec_flags & ASF_FLAG_GRAB && item.classname == "item_flag_team")) + if(((it.autospec_flags & ASF_SHIELD) && item.invincible_finished) || + ((it.autospec_flags & ASF_STRENGTH) && item.strength_finished) || + ((it.autospec_flags & ASF_MEGA_AR) && item.itemdef == ITEM_ArmorMega) || + ((it.autospec_flags & ASF_MEGA_HP) && item.itemdef == ITEM_HealthMega) || + ((it.autospec_flags & ASF_FLAG_GRAB) && item.classname == "item_flag_team")) { if((it.enemy != toucher) || IS_OBSERVER(it)) { - if(it.autospec_flags & ASF_OBSERVER_ONLY && !IS_OBSERVER(it)) + if((it.autospec_flags & ASF_OBSERVER_ONLY) && !IS_OBSERVER(it)) { if(it.superspec_flags & SSF_VERBOSE) superspec_msg("", "", it, sprintf("^8Ignored that ^7%s^8 grabbed %s^8 since the observer_only option is ON\n", toucher.netname, item.netname), 2); @@ -346,7 +346,7 @@ MUTATOR_HOOKFUNCTION(superspec, SV_ParseClientCommand) if(cmd_name == "followpowerup") { - FOREACH_CLIENT(IS_PLAYER(it) && (it.strength_finished > time || it.invincible_finished > time), { return superspec_Spectate(player, it); }); + FOREACH_CLIENT(IS_PLAYER(it) && (STAT(STRENGTH_FINISHED, it) > time || it.invincible_finished > time), { return superspec_Spectate(player, it); }); superspec_msg("", "", player, "No active powerup\n", 1); return true; @@ -354,7 +354,7 @@ MUTATOR_HOOKFUNCTION(superspec, SV_ParseClientCommand) if(cmd_name == "followstrength") { - FOREACH_CLIENT(IS_PLAYER(it) && it.strength_finished > time, { return superspec_Spectate(player, it); }); + FOREACH_CLIENT(IS_PLAYER(it) && STAT(STRENGTH_FINISHED, it) > time, { return superspec_Spectate(player, it); }); superspec_msg("", "", player, "No active Strength\n", 1); return true; @@ -442,7 +442,7 @@ MUTATOR_HOOKFUNCTION(superspec, PlayerDies) entity frag_target = M_ARGV(2, entity); FOREACH_CLIENT(IS_SPEC(it), { - if(it.autospec_flags & ASF_FOLLOWKILLER && IS_PLAYER(frag_attacker) && it.enemy == frag_target) + if((it.autospec_flags & ASF_FOLLOWKILLER) && IS_PLAYER(frag_attacker) && it.enemy == frag_target) { if(it.autospec_flags & ASF_SHOWWHAT) superspec_msg("", "", it, sprintf("^7Following %s^7 due to followkiller\n", frag_attacker.netname), 2);