X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcl_player.qc;h=68a2de343901fba60b3c926e7a9a42121cc68e69;hb=edca1c788f1959742f4e6872186d695c159391d6;hp=1f5d8a12532e5f19b28ba1ee6eda9e041538b1ca;hpb=2bb2db9c0f8016645a23381d7493588d748ecacf;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 1f5d8a125..68a2de343 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -274,8 +274,9 @@ void SpawnThrownWeapon (vector org, float w) } else { - if(W_IsWeaponThrowable(self.weapon)) - W_ThrowNewWeapon(self, self.weapon, FALSE, org, randomvec() * 125 + '0 0 200'); + if(WEPSET_CONTAINS_EW(self, self.weapon)) + if(W_IsWeaponThrowable(self.weapon)) + W_ThrowNewWeapon(self, self.weapon, FALSE, org, randomvec() * 125 + '0 0 200'); } } @@ -395,7 +396,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht //self.pushltime = 0; self.istypefrag = 0; } - else if(attacker.classname == "player") + else if(IS_PLAYER(attacker)) { self.pusher = attacker; self.pushltime = time + autocvar_g_maxpushtime; @@ -415,6 +416,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; @@ -496,18 +498,18 @@ 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 && attacker.classname == "player") - PlayerScore_Add(attacker, SP_SCORE, (damage - excess) * autocvar_g_ca_damage2score_multiplier); + if(g_ca && self != attacker && IS_PLAYER(attacker)) + PlayerTeamScore_Add(attacker, SP_SCORE, ST_SCORE, (damage - excess) * autocvar_g_ca_damage2score_multiplier); float abot, vbot, awep; - abot = (clienttype(attacker) == CLIENTTYPE_BOT); - vbot = (clienttype(self) == CLIENTTYPE_BOT); + abot = (IS_BOT_CLIENT(attacker)); + vbot = (IS_BOT_CLIENT(self)); valid_damage_for_weaponstats = 0; awep = 0; - if(vbot || clienttype(self) == CLIENTTYPE_REAL) - if(abot || clienttype(attacker) == CLIENTTYPE_REAL) + if(vbot || IS_REAL_CLIENT(self)) + if(abot || IS_REAL_CLIENT(attacker)) if(attacker && self != attacker) if(IsDifferentTeam(self, attacker)) { @@ -587,7 +589,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht Portal_ClearAllLater(self); - if(clienttype(self) == CLIENTTYPE_REAL) + if(IS_REAL_CLIENT(self)) { self.fixangle = TRUE; //msg_entity = self; @@ -602,7 +604,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht // player could have been miraculously resuscitated ;) // e.g. players in freezetag get frozen, they don't really die - if(self.health >= 1 || self.classname != "player") + if(self.health >= 1 || !IS_PLAYER(self)) return; // when we get here, player actually dies @@ -653,7 +655,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht else self.respawn_countdown = -1; // do not count down - if(g_lms || g_cts || autocvar_g_forced_respawn) + if(g_cts || autocvar_g_forced_respawn) self.respawn_flags = self.respawn_flags | RESPAWN_FORCE; self.death_time = time; @@ -708,7 +710,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f msgin = formatmessage(msgin); - if(source.classname != "player") + if not(IS_PLAYER(source)) colorstr = "^0"; // black for spectators else if(teamplay) colorstr = Team_ColorCode(source.team); @@ -868,7 +870,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f } if(!privatesay) - if(source.classname != "player") + if not(IS_PLAYER(source)) { if not(intermission_running) if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !(inWarmupStage || gameover))) @@ -936,7 +938,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f { sprint(source, sourcemsgstr); dedicated_print(msgstr); // send to server console too - FOR_EACH_REALCLIENT(head) if(head.classname != "player") + FOR_EACH_REALCLIENT(head) if not(IS_PLAYER(head)) if(head != source) sprint(head, msgstr); } @@ -1109,7 +1111,7 @@ void FakeGlobalSound(string sample, float chan, float voicetype) if(self.pusher) { msg_entity = self; - if(clienttype(msg_entity) == CLIENTTYPE_REAL) + if(IS_REAL_CLIENT(msg_entity)) soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE); } break; @@ -1138,7 +1140,7 @@ void FakeGlobalSound(string sample, float chan, float voicetype) } break; case VOICETYPE_TAUNT: - if(self.classname == "player") + if(IS_PLAYER(self)) if(self.deadflag == DEAD_NO) animdecide_setaction(self, ANIMACTION_TAUNT, TRUE); if(!sv_taunt) @@ -1182,7 +1184,7 @@ void GlobalSound(string sample, float chan, float voicetype) if(self.pusher) { msg_entity = self.pusher; - if(clienttype(msg_entity) == CLIENTTYPE_REAL) + if(IS_REAL_CLIENT(msg_entity)) { if(msg_entity.cvar_cl_voice_directional == 1) soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); @@ -1195,7 +1197,7 @@ void GlobalSound(string sample, float chan, float voicetype) if(self.pusher) { msg_entity = self.pusher; - if(clienttype(msg_entity) == CLIENTTYPE_REAL) + if(IS_REAL_CLIENT(msg_entity)) { if(msg_entity.cvar_cl_voice_directional == 1) soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); @@ -1203,7 +1205,7 @@ void GlobalSound(string sample, float chan, float voicetype) soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } msg_entity = self; - if(clienttype(msg_entity) == CLIENTTYPE_REAL) + if(IS_REAL_CLIENT(msg_entity)) soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE); } break; @@ -1235,7 +1237,7 @@ void GlobalSound(string sample, float chan, float voicetype) } break; case VOICETYPE_TAUNT: - if(self.classname == "player") + if(IS_PLAYER(self)) if(self.deadflag == DEAD_NO) animdecide_setaction(self, ANIMACTION_TAUNT, TRUE); if(!sv_taunt)