Reset all ammo fields for when they join/respawn in MP games.
This commit is contained in:
parent
04019acc01
commit
9c743449c5
3 changed files with 15 additions and 13 deletions
|
@ -330,6 +330,8 @@ Game_PutClientInServer(void)
|
|||
}
|
||||
Weapons_RefreshAmmo(pl);
|
||||
} else {
|
||||
Game_SetNewParms();
|
||||
Game_DecodeChangeParms();
|
||||
spot = Spawn_SelectRandom("info_player_deathmatch");
|
||||
setorigin(pl, spot.origin);
|
||||
pl.angles = spot.angles;
|
||||
|
|
|
@ -59,18 +59,18 @@ void item_weaponbox::touch(void)
|
|||
pl.ammo_hornet += ammo_hornet;
|
||||
|
||||
/* cull */
|
||||
pl.ammo_9mm = max(pl.ammo_9mm, MAX_A_9MM);
|
||||
pl.ammo_357 = max(pl.ammo_357, MAX_A_357);
|
||||
pl.ammo_buckshot = max(pl.ammo_buckshot, MAX_A_BUCKSHOT);
|
||||
pl.ammo_m203_grenade = max(pl.ammo_m203_grenade, MAX_A_M203_GRENADE);
|
||||
pl.ammo_bolt = max(pl.ammo_bolt, MAX_A_BOLT);
|
||||
pl.ammo_rocket = max(pl.ammo_rocket, MAX_A_ROCKET);
|
||||
pl.ammo_uranium = max(pl.ammo_uranium, MAX_A_URANIUM);
|
||||
pl.ammo_handgrenade = max(pl.ammo_handgrenade, MAX_A_HANDGRENADE);
|
||||
pl.ammo_satchel = max(pl.ammo_satchel, MAX_A_SATCHEL);
|
||||
pl.ammo_tripmine = max(pl.ammo_tripmine, MAX_A_TRIPMINE);
|
||||
pl.ammo_snark = max(pl.ammo_snark, MAX_A_SNARK);
|
||||
pl.ammo_hornet = max(pl.ammo_hornet, MAX_A_HORNET);
|
||||
pl.ammo_9mm = min(pl.ammo_9mm, MAX_A_9MM);
|
||||
pl.ammo_357 = min(pl.ammo_357, MAX_A_357);
|
||||
pl.ammo_buckshot = min(pl.ammo_buckshot, MAX_A_BUCKSHOT);
|
||||
pl.ammo_m203_grenade = min(pl.ammo_m203_grenade, MAX_A_M203_GRENADE);
|
||||
pl.ammo_bolt = min(pl.ammo_bolt, MAX_A_BOLT);
|
||||
pl.ammo_rocket = min(pl.ammo_rocket, MAX_A_ROCKET);
|
||||
pl.ammo_uranium = min(pl.ammo_uranium, MAX_A_URANIUM);
|
||||
pl.ammo_handgrenade = min(pl.ammo_handgrenade, MAX_A_HANDGRENADE);
|
||||
pl.ammo_satchel = min(pl.ammo_satchel, MAX_A_SATCHEL);
|
||||
pl.ammo_tripmine = min(pl.ammo_tripmine, MAX_A_TRIPMINE);
|
||||
pl.ammo_snark = min(pl.ammo_snark, MAX_A_SNARK);
|
||||
pl.ammo_hornet = min(pl.ammo_hornet, MAX_A_HORNET);
|
||||
|
||||
pl.g_items |= weapon_items;
|
||||
Weapons_RefreshAmmo(pl);
|
||||
|
|
|
@ -29,7 +29,7 @@ void Player_Death(int hit)
|
|||
pl.takedamage = DAMAGE_NO;
|
||||
pl.flags &= ~FL_FLASHLIGHT;
|
||||
pl.armor = pl.activeweapon = pl.g_items = 0;
|
||||
|
||||
|
||||
pl.think = PutClientInServer;
|
||||
pl.nextthink = time + 4.0f;
|
||||
sound(pl, CHAN_AUTO, "fvox/flatline.wav", 1.0, ATTN_NORM);
|
||||
|
|
Loading…
Reference in a new issue