`adjust` must be set to -1 for a team kill, but this was only done as a
side effect of updating game-local kill counts. After 5f2ec67,
game-local kill counts are not updated in team hoard, but adjust is
still used. Move the handling of adjust up to occur in all team games.
Fixes: 5f2ec6789f ("Restore !hoard guard for game-local kill accounting")
Objects are overwritten without using obj_allocate, so the normal poison
path is not triggered. Poison objects explicitly to trap uninitialized
data from a previous level.
This also fixes an unreported issue where player shields always reset to
100 on entering a new level. The game is supposed to raise shields to
100 if the player was lower on exiting the level. However, it is not
supposed to reduce shields to 100 if the player had a higher value on
exiting the level.
This also fixes a demo consistency issue reported by zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/168>.
Fixes: 2e28a491f2 ("Move player shields to struct object")
gr_remap_mono_fonts searches for fonts with !(font->ft_flags & FT_COLOR)
and calls gr_remap_font on any it finds.
gr_remap_font starts with:
if (!(font->ft_flags & FT_COLOR))
return;
derhass reported that using demo content allows the user to select
non-demo weapons, which then render incorrectly. derhass observed the
problem when the game automatically changed weapons, but affected users
can also select the missing weapon by hand. Demo data sets non-demo
weapons to have zero ammo_usage, so a player has "enough" rounds even
when he has none. Past releases blocked this through the dedicated
secondary_weapon_flags field. Add an explicit check for non-zero ammo.
Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/issues/165>
Commit 7da64d3 added the ability to select a weapon when firing stops.
However, it did not take into account that
select_primary_weapon/select_secondary_weapon do not check whether the
selected weapon is available. The caller must perform that check. The
draft version proposed by Mako88 in the original feature request mostly
avoided the problem by clearing the delayed auto-select when it was
first applied. That version would only manifest the problem if the
player had a delayed auto-select and lost the weapon before resolving
it, whether due to death, a thief bot, or, in the case of mines,
direct-dropping the last mine by the "Drop Bomb" key.
The version that went in switched to using delayed==active to indicate
that no change was required. Under that design, the incorrect
auto-select appears if the player loses the active weapon even if no
delayed selection was pending.
Add a check that the player has the weapon before switching to it and
reset delayed=current if the delayed weapon is not available. This
fixes all known cases under which a spurious delayed selection could
activate a missing weapon and prevents repeated checks for weapon
availability.
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/158>
Fixes: 7da64d3782 ("Add new autoselect-while-firing mode: "when firing stops"")
The count of mines was not decremented, so a player who entered the loop
could continue to drop until (d_rand() < rthresh) became false. Halving
rthresh on each pass guaranteed that it would stop, but with the right
string of random numbers, the player could drop more mines than he had.
Remove the ==1 qualifier, so that mines can spawn whenever one will be
lost to rounding.