From: Mario Date: Fri, 2 Oct 2020 03:09:31 +0000 (+1000) Subject: Clean up buffs_BuffModel_Customize, fix some duplicate checks X-Git-Tag: xonotic-v0.8.5~744 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=791549348070a5941dd51419b8d285518e2d4437;p=xonotic%2Fxonotic-data.pk3dir.git Clean up buffs_BuffModel_Customize, fix some duplicate checks --- 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); }