Counter-Strike: Make sure we drop our current weapon, as well as the C4
bomb if we do happen to carry it.
This commit is contained in:
parent
3b0d7b7fdc
commit
9ace996ada
4 changed files with 18 additions and 4 deletions
|
@ -88,7 +88,7 @@ CSEv_BuyWeapon_f(float fWeapon)
|
|||
/* we're over the slot limit. */
|
||||
if (c >= maxit) {
|
||||
pl.activeweapon = i;
|
||||
CSEv_DropWeapon();
|
||||
Weapon_DropCurrentWeapon(pl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,6 +53,14 @@ CSMultiplayerRules::PlayerDeath(player pl)
|
|||
g_dmg_eAttacker.frags++;
|
||||
}
|
||||
|
||||
Weapon_DropCurrentWeapon(pl);
|
||||
|
||||
/* if we're the bomb carrier, make sure we drop the bomb. */
|
||||
if (pl.g_items & ITEM_C4BOMB) {
|
||||
pl.activeweapon = WEAPON_C4BOMB;
|
||||
Weapon_DropCurrentWeapon(pl);
|
||||
}
|
||||
|
||||
/* clear all ammo and inventory... */
|
||||
PlayerClearWeaponry(pl);
|
||||
|
||||
|
|
|
@ -150,6 +150,7 @@ w_c4bomb_precache(void)
|
|||
precache_sound("weapons/c4_beep5.wav");
|
||||
precache_sound("weapons/c4_explode1.wav");
|
||||
precache_model("models/w_c4.mdl");
|
||||
precache_model("models/w_backpack.mdl");
|
||||
precache_model("models/p_c4.mdl");
|
||||
precache_model("sprites/ledglow.spr");
|
||||
#else
|
||||
|
@ -168,7 +169,7 @@ w_c4bomb_updateammo(player pl)
|
|||
string
|
||||
w_c4bomb_wmodel(void)
|
||||
{
|
||||
return "models/w_c4.mdl";
|
||||
return "models/w_backpack.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
|
|
|
@ -392,9 +392,8 @@ void Weapons_ReloadWeapon(player pl, .int mag, .int ammo, int max)
|
|||
}
|
||||
}
|
||||
|
||||
void CSEv_DropWeapon(void)
|
||||
void Weapon_DropCurrentWeapon(player pl)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
static void DropWeapon_Enable(void)
|
||||
{
|
||||
|
@ -421,4 +420,10 @@ void CSEv_DropWeapon(void)
|
|||
drop.avelocity[1] = 500;
|
||||
Weapons_RemoveItem(pl, pl.activeweapon);
|
||||
}
|
||||
|
||||
void CSEv_DropWeapon(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
Weapon_DropCurrentWeapon(pl);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue