From cc618887424430bf38a0a062b434c323ef2d8ff7 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 31 Dec 2011 13:04:30 +0100 Subject: [PATCH] try getting rid of the CSQCMODEL_EF_INVISIBLE hack and use alpha instead --- qcsrc/server/cl_client.qc | 11 +++++------ qcsrc/server/cl_player.qc | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index e8ccc07d7..825192580 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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); diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 4d20ed736..c6d09327c 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -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); } -- 2.39.2