X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fcl_player.qc;h=ffd6dcd45ad3da72a57d2c48ad8995a5adcc5f16;hp=f00d42df275b032424f099cf76910ef941b8b03a;hb=1f988ad58a9fb5cef7ed843ad839b23dd23f6dc9;hpb=e63ba76493751c027455b946d0b94b3a5beace47 diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index f00d42df2..ffd6dcd45 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -245,7 +245,7 @@ void player_anim (void) else deadbits = ANIMSTATE_DEAD2; float animbits = deadbits; - if(self.freezetag_frozen) + if(self.frozen) animbits |= ANIMSTATE_FROZEN; if(self.crouch) animbits |= ANIMSTATE_DUCK; @@ -262,21 +262,9 @@ void player_anim (void) void SpawnThrownWeapon (vector org, float w) { - if(g_pinata) - { - float j; - for(j = WEP_FIRST; j <= WEP_LAST; ++j) - { - if(WEPSET_CONTAINS_EW(self, j)) - if(W_IsWeaponThrowable(j)) - W_ThrowNewWeapon(self, j, FALSE, org, randomvec() * 175 + '0 0 325'); - } - } - else - { + if(self.weapons & WepSet_FromWeapon(self.weapon)) if(W_IsWeaponThrowable(self.weapon)) W_ThrowNewWeapon(self, self.weapon, FALSE, org, randomvec() * 125 + '0 0 200'); - } } void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) @@ -295,11 +283,11 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float if(sound_allowed(MSG_BROADCAST, attacker)) { if (save > 10) - sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTN_NORM); + sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTEN_NORM); else if (take > 30) - sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTN_NORM); + sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTEN_NORM); else if (take > 10) - sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTN_NORM); + sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTEN_NORM); } if (take > 50) @@ -415,6 +403,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht frag_inflictor = inflictor; frag_attacker = attacker; frag_target = self; + frag_damage = damage; damage_take = take; damage_save = save; damage_force = force; @@ -426,11 +415,11 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht if(sound_allowed(MSG_BROADCAST, attacker)) { if (save > 10) - sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTN_NORM); + sound (self, CH_SHOTS, "misc/armorimpact.wav", VOL_BASE, ATTEN_NORM); else if (take > 30) - sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTN_NORM); + sound (self, CH_SHOTS, "misc/bodyimpact2.wav", VOL_BASE, ATTEN_NORM); else if (take > 10) - sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTN_NORM); // FIXME possibly remove them? + sound (self, CH_SHOTS, "misc/bodyimpact1.wav", VOL_BASE, ATTEN_NORM); // FIXME possibly remove them? } if (take > 50) @@ -496,9 +485,6 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht self.dmg_take = self.dmg_take + take;//max(take - 10, 0); self.dmg_inflictor = inflictor; - if(g_ca && self != attacker && IS_PLAYER(attacker)) - PlayerScore_Add(attacker, SP_SCORE, (damage - excess) * autocvar_g_ca_damage2score_multiplier); - float abot, vbot, awep; abot = (IS_BOT_CLIENT(attacker)); vbot = (IS_BOT_CLIENT(self)); @@ -627,7 +613,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht self.solid = SOLID_CORPSE; self.ballistics_density = autocvar_g_ballistics_density_corpse; // don't stick to the floor - self.flags &~= FL_ONGROUND; + self.flags &= ~FL_ONGROUND; // dying animation self.deadflag = DEAD_DYING; // when to allow respawn @@ -1110,15 +1096,15 @@ void FakeGlobalSound(string sample, float chan, float voicetype) { msg_entity = self; if(IS_REAL_CLIENT(msg_entity)) - soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE); + soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTEN_NONE); } break; case VOICETYPE_TEAMRADIO: msg_entity = self; if(msg_entity.cvar_cl_voice_directional == 1) - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN); else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE); break; case VOICETYPE_AUTOTAUNT: if(!sv_autotaunt) @@ -1132,9 +1118,9 @@ void FakeGlobalSound(string sample, float chan, float voicetype) if (tauntrand < msg_entity.cvar_cl_autotaunt) { if (msg_entity.cvar_cl_voice_directional >= 1) - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX)); else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE); } break; case VOICETYPE_TAUNT: @@ -1147,13 +1133,13 @@ void FakeGlobalSound(string sample, float chan, float voicetype) break; msg_entity = self; if (msg_entity.cvar_cl_voice_directional >= 1) - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX)); else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE); break; case VOICETYPE_PLAYERSOUND: msg_entity = self; - soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NORM); + soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTEN_NORM); break; default: backtrace("Invalid voice type!"); @@ -1185,9 +1171,9 @@ void GlobalSound(string sample, float chan, float voicetype) if(IS_REAL_CLIENT(msg_entity)) { if(msg_entity.cvar_cl_voice_directional == 1) - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN); else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE); } } break; @@ -1198,13 +1184,13 @@ void GlobalSound(string sample, float chan, float voicetype) if(IS_REAL_CLIENT(msg_entity)) { if(msg_entity.cvar_cl_voice_directional == 1) - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN); else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE); } msg_entity = self; if(IS_REAL_CLIENT(msg_entity)) - soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE); + soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTEN_NONE); } break; case VOICETYPE_TEAMRADIO: @@ -1212,9 +1198,9 @@ void GlobalSound(string sample, float chan, float voicetype) if(!teamplay || msg_entity.team == self.team) { if(msg_entity.cvar_cl_voice_directional == 1) - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_MIN); else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE); } break; case VOICETYPE_AUTOTAUNT: @@ -1229,9 +1215,9 @@ void GlobalSound(string sample, float chan, float voicetype) if (tauntrand < msg_entity.cvar_cl_autotaunt) { if (msg_entity.cvar_cl_voice_directional >= 1) - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX)); else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE); } break; case VOICETYPE_TAUNT: @@ -1245,13 +1231,13 @@ void GlobalSound(string sample, float chan, float voicetype) FOR_EACH_REALCLIENT(msg_entity) { if (msg_entity.cvar_cl_voice_directional >= 1) - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTEN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTEN_MAX)); else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTEN_NONE); } break; case VOICETYPE_PLAYERSOUND: - sound(self, chan, sample, VOL_BASE, ATTN_NORM); + sound(self, chan, sample, VOL_BASE, ATTEN_NORM); break; default: backtrace("Invalid voice type!");