Commit graph

10487 commits

Author SHA1 Message Date
Kp 4eb61ecf5c Fix original game bug: failure to reset Level_shake_duration
The game has an alternative level file format that is not normally used.
This format can enable seismic events on a timer, independent of reactor
countdown or earthshaker usage.  However, this feature is not reset on
loading a regular level after playing a level with the timer-driven
seismic events, so the regular level shakes according to the timer, even
though its author never designed it to do so.

Fix that by resetting the timer state to 0 before loading a regular
level.
2019-08-06 02:59:41 +00:00
Kp ad16d90dd5 Move Secret_return_segment to d_level_shared_segment_state 2019-08-06 02:59:41 +00:00
Kp 7691e98304 Factor out seismic effect processing
Level seismic events and Earthshaker seismic events start with different
intensities, but share everything afterward.  Move the common parts to a
function.
2019-08-06 02:59:41 +00:00
Kp 625d863c55 Move Smega_detonate_times to d_level_unique_seismic_state::Earthshaker_detonate_times 2019-08-06 02:59:41 +00:00
Kp 140711cb35 Move Next_seismic_sound_time to d_level_unique_seismic_state 2019-08-06 02:59:41 +00:00
Kp 596a17db69 Fold Seismic_sound_playing into Next_seismic_sound_time
When Next_seismic_sound_time is non-zero, a seismic sound is playing.
When Next_seismic_sound_time is zero, no sound is playing.  Use this to
eliminate the explicit tracking variable Seismic_sound_playing.
2019-08-06 02:59:41 +00:00
Kp 8fd231e501 Move Seismic_tremor_volume to d_level_unique_seismic_state 2019-08-06 02:59:41 +00:00
Kp 42778ff7fa Move Level_shake_duration to d_level_shared_seismic_state 2019-08-06 02:59:41 +00:00
Kp b8fa75c8cb Move Level_shake_frequency to d_level_shared_seismic_state 2019-08-06 02:59:41 +00:00
Kp 184337e6e1 Move Seismic_disturbance_end_time to d_level_unique_seismic_state 2019-08-06 02:59:40 +00:00
Kp ef0e64d421 Move awareness events to d_level_unique_robot_awareness_state 2019-08-06 02:59:40 +00:00
Kp 03214c0e6f Fix original game bug that meant to reset camera flag, but did not 2019-08-06 02:59:40 +00:00
Kp 215252b8ca Fold Final_boss_is_dead into Final_boss_countdown_time 2019-08-06 02:59:40 +00:00
Kp 5455a65d33 Move Final_boss_countdown_time to d_game_unique_state 2019-08-06 02:59:40 +00:00
Kp 3d8c02fefa Move Final_boss_is_dead to d_game_unique_state 2019-08-06 02:59:40 +00:00
Kp 7d803cf63e Move some save/restore functions to dcx/dsx as appropriate 2019-08-06 02:59:40 +00:00
Kp be84013494 Move Boss_hit_time to d_level_unique_boss_state 2019-08-06 02:59:40 +00:00
Kp 0a74eb6989 Move Boss_hit_this_frame to d_level_unique_boss_state 2019-08-06 02:59:40 +00:00
Kp 75440153a0 Move Boss_dying_sound_playing to d_level_unique_boss_state 2019-08-06 02:59:40 +00:00
Kp a0c242c46f Move Boss_dying_start_time to d_level_unique_boss_state 2019-08-06 02:59:40 +00:00
Kp 63d869fa0c Move Boss_dying to d_level_unique_boss_state 2019-08-06 02:59:40 +00:00
Kp 4ec96337b6 Move Last_teleport_time to d_level_unique_boss_state 2019-08-06 02:59:40 +00:00
Kp 69404ebc6e Move Boss_cloak_start_time to d_level_unique_boss_state 2019-08-06 02:59:40 +00:00
Kp 184be218b7 Emulate D1 bosses more accurately
Use D1 timing for gating, cloaking, and teleporting
2019-08-06 02:59:40 +00:00
Kp 49fd1f358e Eliminate unnecessary Gamesave_current_filename
It is only read in contexts where the initializing filename is still
available, so pass the filename down instead of copying it to a global.
2019-08-06 02:59:40 +00:00
Kp de77d2412b Move Automap_visited to d_level_unique_automap_state 2019-08-06 02:59:40 +00:00
ziplantil bea2eaaec9 exit tunnel cover shape: make code neater 2019-07-29 00:57:55 +03:00
ziplantil e6f07a7b2f add black shape to cover 'mine' after exit hatch blows up 2019-07-29 00:43:04 +03:00
Kp dde11d0495 Merge https://github.com/ziplantil/dxx-rebirth.git branch 'cloakeffect' 2019-07-28 21:34:48 +00:00
Kp 445a734779 buddy_message_ignore_time: respect guidebot cage
Commit dc79bb8e4a intended to clean up processing guidebot messages,
but accidentally allowed the guidebot to report certain status messages
before its cage was opened.  Normal missions still do not report these
messages, but some custom levels do.

Reported-by: ziplantil <https://github.com/dxx-rebirth/dxx-rebirth/issues/438>
Fixes: dc79bb8e4a ("Remove hack for bypassing buddy time restriction")
2019-07-28 21:09:07 +00:00
Kp 635ae0b595 Use typedef for savegame description 2019-07-28 21:09:07 +00:00
Kp 5683c2b6ed Simplify skipping unnecessary callsign in savegame preview 2019-07-28 21:09:07 +00:00
Kp f43141f738 Use typedef for savegame file path 2019-07-28 21:09:07 +00:00
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