`explode_badass_player` can pass an OBJ_PLAYER, not an OBJ_WEAPON, as
`obj_explosion_origin`. Using `get_weapon_id` on a non-weapon is wrong
and provokes a diagnostic. The test tries to check if the passed object
is _not_ a flash missile. Players are not flash missiles, so maintain
the intended semantics by treating non-weapons as not-flash-missiles.
Reported-by: Johnsondr80 <https://github.com/dxx-rebirth/dxx-rebirth/issues/437>
`objp`, `obj`, and `obj0p` is not helpful when trying to reason about
the logic of this function. Rename them to `obj_explosion_origin`,
`obj_fireball`, and `obj_iter`, respectively.
Reading from Players[] while not in a game is not well-defined. Get the
local player's callsign from InterfaceUniqueState instead.
Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/435>
Fixes: bea95ce1df ("Reset definedness of per-game globals on new game")
It is reinitialized if the segment is a special segment, but not
reinitialized if the segment is a normal segment. Most segments are
normal segments. The absence of this initialization permitted players
to keep the value from a prior level. For normal segments, this would
normally not be a problem, because the value is only meaningful for
special segments. However, the netgame synchronization code always
mixes in the value of every station_idx, regardless of whether the
segment is a special segment. As a result, late-joining guests who
started directly onto the current level could disagree with the host
about the value, causing a synchronization mismatch. The host would be
wrong, but the guests would be blocked from joining. For this purpose,
late-joining includes both people who joined the campaign late and
people who left the game and restarted the program, even if they had
previously been in the game.
Reported-by: OldSaltyGamer <https://forum.dxx-rebirth.com/showthread.php?tid=1098&pid=12630#pid12630>
[ Possibly also previously reported by LightWolf, but that report never
had enough information to proceed. The report from OldSaltyGamer solved
this. ]
Fixes: 596ecbb38d ("Rename segment::value to segment::station_idx")
`flags` only needs to be 1 bit wide, so switch from `int` to `uint8_t`.
Shrinking to a single bit would not save more space, but would
complicate the code.
It has always been here, but appears to serve no purpose.
`multi_explode_robot_sub` clears `Stolen_items`, so at first look, this
swap seems to be preserving the prior values. However,
`multi_send_robot_explode` does not use `Stolen_items`, and after
`multi_send_robot_explode` completes, `Stolen_items` is explicitly wiped
again. Thus, removing the whole block will let the wipe performed by
`multi_explode_robot_sub` stand, producing the same result with less
code.
The number of hostages in a game is a function of the the game's levels,
not any particular player. Move it to d_game_unique_state and rename it
to total_hostages.
The number of hostages on a level is a function of the level, not any
particular player. Move it to d_level_unique_object_state and rename it
to total_hostages.
The number of robots accumulated in a game is a function of the the
game's levels, not any particular player. Move it to
d_game_unique_state and rename it to accumulated_robots.
The number of robots accumulated on a level is a function of the level,
not any particular player. Move it to d_level_unique_object_state and
rename it to accumulated_robots.
In Descent 1, up until commit 8291391, boss robots teleported without
regard to whether the player was visible or active. Commit 8291391
changed that in an attempt to make the D2 emulation of D1 boss robots
behave well in levels that relied on the D2 quirk of spawning the boss
in a confined segment, then letting it teleport freely once the player
releases it. However, that change applied even in D1 missions and in
the D1 engine, where maps were designed with the expectation that boss
robots teleported routinely. Restrict the new rule to the D2 engine
playing D2 levels. This enables boss robots to teleport freely on D1
missions, regardless of which engine is used. It would be better if
there were a level flag explaining whether the author wanted the boss to
teleport freely, but there is no such flag, so this heuristic must
suffice.
Reported-by: TheMiracleMatter <https://github.com/dxx-rebirth/dxx-rebirth/issues/434>
Fixes: 8291391b7f ("Fix D2 emulation of D1 boss teleport handling")
Commit 829e95b6 meant to remove the restriction that the game not be
hoard mode, but incorrectly also removed the restriction that the game
be multiplayer. Restore the multiplayer restriction.
Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/433>
Fixes: 829e95b6f8 ("Separate hoard/proximity tracking")
This removes the need to walk all objects when creating a new one, since
each object can have a private generation counter, unaware of other
objects. For compatibility with demos, mix in the object's index when
writing the signature value.
`init_new_page` calls `load_briefing_screen` with the a pointer to
`br->background_name`, which causes a strncpy of the form
```
strncpy(X, X, N);
```
Valgrind warns for this overlap. The copy is useless in that case, so
skip it.