From c5fbc5b5d03d71370c444a901664fa27138bdd24 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Tue, 12 Apr 2011 23:12:07 +0300 Subject: [PATCH] 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. --- qcsrc/common/constants.qh | 1 + qcsrc/server/cl_player.qc | 1 + qcsrc/server/w_hagar.qc | 4 ++++ 3 files changed, 6 insertions(+) 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"); -- 2.39.2