Go to file
Kp bcb3f6b486 apply_force_damage: check object type before accessing ctype union
When `apply_force_damage` was called to damage a robot, it tested if the
`ctype.laser_info.parent_signature` of the other object matched
`ConsoleObject->signature` and, if so, awarded points to the console
player.  This allowed the player to sometimes get points for ramming a
robot to death, but was buggy.  When the player rams a robot, the player
is the other object, so accessing `ctype.laser_info` is wrong.
Historically, the player's signature was zero and player
`ctype.laser_info.parent_signature` (an inactive and therefore incorrect
branch of the union) happened to be zero, so the test succeeded.  Commit
44753209d6 changed the layout of
`struct player_info` such that
`ConsoleObject->ctype.laser_info.parent_signature` was not zero, causing
the player not to be his own parent.  Prior to this commit, the player
could still wrongly fail the test if the `player_info` member that
aliased `laser_info.parent_signature` was nonzero.  In the commit
preceding the obvious break, `player_info.player_flags` aliased
`laser_info.parent_signature`, so a player with certain flags (such as
invulnerability) would wrongly fail the test.  The exact manifestation
has changed over time as `struct player_info` gained members.

Restructure the test so that a ramming kill always awards points,
without checking ancestry.

Reported-by: Descender1032 <https://forum.dxx-rebirth.com/showthread.php?tid=1006> (no commit identifiers given)
Fixes: 44753209d6 ("Move homing_object_dist to object.ctype.player_info")
2017-12-02 04:31:26 +00:00
common Fix songs_play_file use for sdlmixer=0 2017-11-25 01:56:51 +00:00
contrib Update Gentoo ebuilds 2017-11-25 01:56:51 +00:00
d1x-rebirth Merge branch 'psyke83/rpi' into master 2017-10-26 02:02:50 +00:00
d2x-rebirth Add experimental D2 support for D1 style robot briefings 2017-11-13 01:59:49 +00:00
Documentation
similar apply_force_damage: check object type before accessing ctype union 2017-12-02 04:31:26 +00:00
.gitattributes Add experimental Windows manifest 2017-08-02 02:49:12 +00:00
.gitignore
COPYING.txt
GPL-3.txt
INSTALL.markdown Restore GOG reference in INSTALL.markdown 2017-11-25 01:56:51 +00:00
SConstruct Move various SDL-only texture mapping functions to !DXX_USE_OGL 2017-11-01 02:01:21 +00:00