From: Mircea Kitsune Date: Tue, 12 Apr 2011 20:12:07 +0000 (+0300) Subject: Implement a new weapon check called WR_PLAYERDEATH. It will be used in the hagar... X-Git-Tag: xonotic-v0.5.0~263^2~10^2~24 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c5fbc5b5d03d71370c444a901664fa27138bdd24;p=xonotic%2Fxonotic-data.pk3dir.git Implement a new weapon check called WR_PLAYERDEATH. It will be used in the hagar code to make players release the rockets they have loaded when they die. --- diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 18cf2f673..7b0ef3834 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -628,6 +628,7 @@ float WR_RELOAD = 9; // (SVQC) does not need to do anything float WR_RESETPLAYER = 10; // (SVQC) does not need to do anything float WR_IMPACTEFFECT = 11; // (CSQC) impact effect float WR_SWITCHABLE = 12; // (CSQC) impact effect +float WR_PLAYERDEATH = 13; // (SVQC) does not need to do anything float HUD_PANEL_WEAPONS = 0; diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 3426c4ce5..5db6a91e5 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -627,6 +627,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht frag_inflictor = inflictor; frag_target = self; MUTATOR_CALLHOOK(PlayerDies); + weapon_action(self.weapon, WR_PLAYERDEATH); if(self.flagcarried) { diff --git a/qcsrc/server/w_hagar.qc b/qcsrc/server/w_hagar.qc index 778b5b82f..89cce0b3b 100644 --- a/qcsrc/server/w_hagar.qc +++ b/qcsrc/server/w_hagar.qc @@ -314,6 +314,10 @@ float w_hagar(float req) ammo_amount += self.weapon_load[WEP_HAGAR] >= autocvar_g_balance_hagar_secondary_ammo; return ammo_amount; } + else if (req == WR_PLAYERDEATH) + { + dprint("!!!!!!!!!!!!!!!!!!!!!!!\n"); + } else if (req == WR_RELOAD) { W_Reload(min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav");