]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
try getting rid of the CSQCMODEL_EF_INVISIBLE hack and use alpha instead
authorRudolf Polzer <divverent@alientrap.org>
Sat, 31 Dec 2011 12:04:30 +0000 (13:04 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 31 Dec 2011 12:04:40 +0000 (13:04 +0100)
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc

index e8ccc07d73330760e9d856b0ca217c30f8c0df56..82519258018d8f39be5b479d48cf1ff7b80b0bdc 100644 (file)
@@ -775,7 +775,6 @@ void PutClientInServer (void)
                }
                self.damageforcescale = 2;
                self.death_time = 0;
-               self.alpha = 0;
                self.scale = 0;
                self.fade_time = 0;
                self.pain_frame = 0;
@@ -1114,7 +1113,7 @@ void KillIndicator_Think()
                return;
        }
 
-       if (self.owner.effects & CSQCMODEL_EF_INVISIBLE)
+       if (self.owner.alpha < 0)
        {
                self.owner.killindicator = world;
                remove(self);
@@ -1696,7 +1695,7 @@ void ClientDisconnect (void)
 void ChatBubbleThink()
 {
        self.nextthink = time;
-       if ((self.owner.effects & CSQCMODEL_EF_INVISIBLE) || self.owner.chatbubbleentity != self)
+       if ((self.owner.alpha < 0) || self.owner.chatbubbleentity != self)
        {
                if(self.owner) // but why can that ever be world?
                        self.owner.chatbubbleentity = world;
@@ -1715,7 +1714,7 @@ void ChatBubbleThink()
 
 void UpdateChatBubble()
 {
-       if (self.effects & CSQCMODEL_EF_INVISIBLE)
+       if (self.alpha < 0)
                return;
        // spawn a chatbubble entity if needed
        if (!self.chatbubbleentity)
@@ -1755,7 +1754,7 @@ void UpdateChatBubble()
 .float oldcolormap;
 void respawn(void)
 {
-       if(!(self.effects & CSQCMODEL_EF_INVISIBLE) && autocvar_g_respawn_ghosts)
+       if(self.alpha >= 0 && autocvar_g_respawn_ghosts)
        {
                self.solid = SOLID_NOT;
                self.takedamage = DAMAGE_NO;
@@ -1806,7 +1805,7 @@ void player_powerups (void)
 
        self.effects &~= (EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
 
-       if((self.effects & CSQCMODEL_EF_INVISIBLE) || self.deadflag) // don't apply the flags if the player is gibbed
+       if(self.alpha < 0 || self.deadflag) // don't apply the flags if the player is gibbed
                return;
 
        Fire_ApplyDamage(self);
index 4d20ed736e9a544abe83ecdfef0f892f56854b5c..c6d09327c466845f67d2368c94566b57d9c3af33 100644 (file)
@@ -408,7 +408,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float
        self.dmg_take = self.dmg_take + take;//max(take - 10, 0);
        self.dmg_inflictor = inflictor;
 
-       if (self.health <= -autocvar_sv_gibhealth && !(self.effects & CSQCMODEL_EF_INVISIBLE))
+       if (self.health <= -autocvar_sv_gibhealth && self.alpha >= 0)
        {
                // don't use any animations as a gib
                self.frame = 0;
@@ -416,7 +416,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float
                self.view_ofs = '0 0 4';
 
                Violence_GibSplash(self, 1, 1, attacker);
-               self.effects |= CSQCMODEL_EF_INVISIBLE;
+               self.alpha = -1;
                self.solid = SOLID_NOT; // restore later
        }
 }
@@ -656,7 +656,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                if(!g_freezetag)
                {
                        // become fully visible
-                       self.alpha = 1;
+                       self.alpha = default_player_alpha;
                        // throw a weapon
                        SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon);
                }