From 791549348070a5941dd51419b8d285518e2d4437 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 2 Oct 2020 13:09:31 +1000 Subject: [PATCH] Clean up buffs_BuffModel_Customize, fix some duplicate checks --- qcsrc/common/mutators/mutator/buffs/sv_buffs.qc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index 30cef339a..be310669d 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@ -20,20 +20,16 @@ REGISTER_MUTATOR(buffs, autocvar_g_buffs) bool buffs_BuffModel_Customize(entity this, entity client) { - entity player, myowner; - bool same_team; - - player = WaypointSprite_getviewentity(client); - myowner = this.owner; - same_team = (SAME_TEAM(player, myowner) || SAME_TEAM(player, myowner)); + entity player = WaypointSprite_getviewentity(client); + entity myowner = this.owner; - if(myowner.alpha <= 0.5 && !same_team && myowner.alpha != 0) + if(myowner.alpha <= 0.5 && DIFF_TEAM(player, myowner) && myowner.alpha != 0) return false; if(MUTATOR_CALLHOOK(BuffModel_Customize, this, player)) return false; - if(player == myowner || (IS_SPEC(client) && client.enemy == myowner)) + if(player == myowner) { // somewhat hide the model, but keep the glow this.effects = 0; @@ -308,8 +304,7 @@ void buff_Think(entity this) if(this.team && !this.buff_waypoint) buff_Waypoint_Spawn(this); - if(this.lifetime) - if(time >= this.lifetime) + if(this.lifetime && time >= this.lifetime) buff_Respawn(this); } -- 2.39.2