Commit graph

10454 commits

Author SHA1 Message Date
Kp 76cfe1368d do_new_game_menu: improve new game dialog text 2019-07-28 21:09:07 +00:00
ziplantil 639d33b4de reorder palfx logic; use inline func in gr_palette_step_up 2019-07-28 12:47:24 +03:00
ziplantil 4f3b2a1520 make alast_* function-local 2019-07-28 01:41:37 +03:00
ziplantil f446790b03 optimize; abs no longer necessary 2019-07-28 00:49:30 +03:00
ziplantil 4eab54284c change palfx code; special only for all < 0 (cloak) 2019-07-28 00:42:37 +03:00
ziplantil 3753e5942d fix effect (on GL) when picking up cloak 2019-07-27 23:38:34 +03:00
Kp ac4f76136b object_create_explosion_sub: check object type before checking flash
`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>
2019-07-27 17:48:03 +00:00
Kp 3511da2a10 object_create_explosion_sub: improve variables' names
`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.
2019-07-27 17:48:03 +00:00
Kp 65555b6eba Require only object_base for object_to_object_visibility 2019-07-27 17:48:03 +00:00
Kp 98ad2402bf Fix Win32 build 2019-07-22 00:51:01 +00:00
Kp dd8cfa763f Expand gcc memcpy workaround
Add link to upstream bug report.
2019-07-22 00:51:01 +00:00
Kp 03130aac2c Fix blank player names in multiplayer
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")
2019-07-20 20:08:29 +00:00
Kp 4759ad660f Update ebuild to latest snapshot
a17792c89f fixes an important multiplayer
bug.
2019-07-20 18:24:24 +00:00
Kp a17792c89f Always initialize station_idx on level start
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")
2019-07-20 18:24:24 +00:00
Kp 347d1ba05f Shrink struct vclip
`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.
2019-07-20 18:24:24 +00:00
Kp ff9cff4fea Relax laser_parent_is_player check so that dead players match
Fixes: bfeca84bb8 ("Change object::signature to be a generation counter")
2019-07-18 02:06:45 +00:00
Kp b19149c7b3 Initialize Netgame name from InterfaceUniqueState
Players[] is not defined at this point.
2019-07-16 04:00:50 +00:00
Kp 4a9e027e02 Fix bug that ignored -pilot
Fixes: d03a6c44b8 ("Register new pilots on menu creation, not activation")
2019-07-16 04:00:50 +00:00
Kp 41f4e84261 Move Stolen_item_index into d_thief_unique_state 2019-07-16 04:00:50 +00:00
Kp a2560cdfb5 Move Stolen_items into d_thief_unique_state 2019-07-16 04:00:50 +00:00
Kp d2da218f94 Remove apply_damage_to_robot swapping of Stolen_items
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.
2019-07-16 04:00:50 +00:00
Kp 91bb7e533c Move player::hostages_total to d_game_unique_state
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.
2019-07-16 04:00:50 +00:00
Kp 8f475021ca Move player::hostages_level to d_level_unique_object_state
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.
2019-07-16 04:00:50 +00:00
Kp 2ca2de6ee7 Move player::num_robots_total to d_game_unique_state
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.
2019-07-16 04:00:50 +00:00
Kp a24de0c003 Move player::num_robots_level to d_level_unique_object_state
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.
2019-07-16 04:00:50 +00:00
Kp 46a327eb35 Move relocated player data to wrapper type 2019-07-16 04:00:50 +00:00
Kp e33aaa7537 Make init_player_stats_level static 2019-07-16 04:00:50 +00:00
Kp c61dee7e6a Move Boss_teleport_interval to d_level_shared_boss_state 2019-07-13 22:28:57 +00:00
Kp 595c3ca086 Move Boss_cloak_interval to d_level_shared_boss_state 2019-07-13 22:28:57 +00:00
Kp b47f84ffd4 Move Gate_interval to d_game_unique_state 2019-07-13 22:28:57 +00:00
Kp 9df482a423 Move Last_gate_time to d_level_unique_boss_state 2019-07-13 22:28:57 +00:00
Kp 46e7f8e3d5 Backport Descent 2 change to ignore objects in AI visibility 2019-07-13 22:28:57 +00:00
Kp a65e461bb6 Restore D1 boss always-teleport in D1 missions
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")
2019-07-13 22:28:57 +00:00
Kp 7bd861e374 Only death-spew armed proximity bombs in multiplayer
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")
2019-07-12 02:01:53 +00:00
Kp f84cdff6a2 Update ebuild to latest snapshot 2019-07-07 22:00:16 +00:00
Kp d413a5da13 Initialize powerup flags at level load 2019-07-07 22:00:02 +00:00
Kp a10077f2ec Skip setting contains_type/contains_id on objects that contain nothing
If the count is zero, then the type and id should be undefined.
2019-07-07 22:00:02 +00:00
Kp 01eb585c7a Set matcen_creator on loaded robots
This avoids a Valgrind warning for use of an uninitialized field.
2019-07-07 22:00:02 +00:00
Kp eeb310467b Fix SDL-only link failure 2019-07-07 22:00:02 +00:00
Kp fcd2ce1b47 Fix SDL-only build of render.cpp 2019-07-07 22:00:02 +00:00
Kp 86053852dc Fix build of SDL-only gr.cpp 2019-07-07 22:00:02 +00:00
Kp 867223556c Fix fallthrough warning in ntmap.cpp [SDL only] 2019-07-07 22:00:02 +00:00
Kp 8d349dd0c1 Include pilot name in window caption 2019-07-07 22:00:02 +00:00
Kp 0c7de10512 Track chosen pilot name outside Players[]
Players need not be defined outside a game, but the pilot's name needs
to be available outside a game.  Therefore, track it outside Players[].
2019-07-07 22:00:02 +00:00
Kp bfeca84bb8 Change object::signature to be a generation counter
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.
2019-07-07 22:00:02 +00:00
Kp efc071e830 Make init_player_stats_ship static 2019-07-07 22:00:02 +00:00
Kp d750b25073 Avoid copying background to itself
`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.
2019-07-07 22:00:02 +00:00
Kp 597cb41717 Downgrade PCX failures from Error to CON_URGENT
There is no need to kill the program due to a missing or malformed PCX file.
2019-07-07 22:00:02 +00:00
Kp 3a0cca001f Limit size of PCX files 2019-07-07 22:00:02 +00:00
Kp e2692d26ab Clear grs_main_bitmap before initializing
No code path has been observed causing a leak by reinitializing without
resetting, but add an explicit reset to prevent future mistakes.
2019-07-07 22:00:02 +00:00