]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
Resolve conflicts 1: Merge commit 'c58baab5' into bones_was_here/q3compat
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / buffs / sv_buffs.qc
index bf680f9a43cb870b8df178fdfb23cdfdfa501d27..2c32b57e421688f56311ae2de16f08325c63c810 100644 (file)
@@ -53,7 +53,7 @@ void buffs_BuffModel_Remove(entity player)
 
 vector buff_GlowColor(entity buff)
 {
-       //if(buff.team) { return Team_ColorRGB(buff.team); }
+       //if(buff.team_forced) { return Team_ColorRGB(buff.team_forced); }
        return buff.m_color;
 }
 
@@ -88,7 +88,7 @@ void buff_Waypoint_Spawn(entity e)
        if(autocvar_g_buffs_waypoint_distance <= 0) return;
 
        entity buff = e.buffdef;
-       entity wp = WaypointSprite_Spawn(WP_Buff, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, NULL, e.team, e, buff_waypoint, true, RADARICON_Buff);
+       entity wp = WaypointSprite_Spawn(WP_Buff, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, NULL, e.team_forced, e, buff_waypoint, true, RADARICON_Buff);
        wp.wp_extra = buff.m_id;
        WaypointSprite_UpdateTeamRadar(e.buff_waypoint, RADARICON_Buff, e.glowmod);
        e.buff_waypoint.waypointsprite_visible_for_player = buff_Waypoint_visible_for_player;
@@ -163,7 +163,7 @@ void buff_Touch(entity this, entity toucher)
        if(!IS_PLAYER(toucher))
                return; // incase mutator changed toucher
 
-       if((this.team && DIFF_TEAM(toucher, this))
+       if((this.team_forced && toucher.team != this.team_forced)
        || (STAT(FROZEN, toucher))
        || (toucher.vehicle)
        || (!this.buffdef) // TODO: error out or maybe reset type if this occurs?
@@ -324,7 +324,7 @@ void buff_Think(entity this)
 
        if(this.buff_active)
        {
-               if(this.team && !this.buff_waypoint)
+               if(this.team_forced && !this.buff_waypoint)
                        buff_Waypoint_Spawn(this);
 
                if(this.lifetime && time >= this.lifetime)
@@ -358,7 +358,7 @@ void buff_Reset(entity this)
 bool buff_Customize(entity this, entity client)
 {
        entity player = WaypointSprite_getviewentity(client);
-       if((!this.buff_active || !this.buffdef) || (this.team && DIFF_TEAM(player, this)))
+       if((!this.buff_active || !this.buffdef) || (this.team_forced && player.team != this.team_forced))
        {
                this.alpha = 0.3;
                if(this.effects & EF_FULLBRIGHT) { this.effects &= ~(EF_FULLBRIGHT); }
@@ -384,8 +384,6 @@ void buff_Init(entity this)
 {
        if(!cvar("g_buffs")) { delete(this); return; }
 
-       if(!teamplay && this.team) { this.team = 0; }
-
        entity buff = this.buffdef;
 
        if(!buff || !buff_Available(buff))
@@ -434,10 +432,13 @@ void buff_Init(entity this)
 
 void buff_Init_Compat(entity ent, entity replacement)
 {
-       if (ent.spawnflags & 2)
-               ent.team = NUM_TEAM_1;
-       else if (ent.spawnflags & 4)
-               ent.team = NUM_TEAM_2;
+       if (teamplay)
+       {
+               if (ent.spawnflags & 2)
+                       ent.team_forced = NUM_TEAM_1;
+               else if (ent.spawnflags & 4)
+                       ent.team_forced = NUM_TEAM_2;
+       }
 
        ent.buffdef = replacement;