Reset boss teleport time on boss initialization
User roncli reports[1] an original game bug that prevents boss teleportation from operating correctly if the program is not restarted between each campaign. This is another case of a global variable being used improperly. Reset the relevant variables when the boss is initialized. [1] https://github.com/dxx-rebirth/dxx-rebirth/issues/366#issuecomment-373199624
This commit is contained in:
parent
e8645b2062
commit
ac29854007
|
@ -182,7 +182,6 @@ static inline void force_dump_ai_objects_all(const char *msg)
|
|||
namespace dsx {
|
||||
void start_boss_death_sequence(vmobjptr_t objp);
|
||||
extern void ai_init_boss_for_ship(void);
|
||||
void boss_init_all_segments(const object &boss_objnum);
|
||||
void init_ai_for_ship();
|
||||
|
||||
#if defined(DXX_BUILD_DESCENT_II)
|
||||
|
|
|
@ -154,8 +154,8 @@ static int Overall_agitation;
|
|||
point_seg_array_t Point_segs;
|
||||
point_seg_array_t::iterator Point_segs_free_ptr;
|
||||
static array<ai_cloak_info, MAX_AI_CLOAK_INFO> Ai_cloak_info;
|
||||
fix64 Boss_cloak_start_time = 0;
|
||||
fix64 Last_teleport_time = 0;
|
||||
fix64 Boss_cloak_start_time;
|
||||
fix64 Last_teleport_time;
|
||||
}
|
||||
namespace dsx {
|
||||
static
|
||||
|
@ -170,7 +170,7 @@ const
|
|||
fix Boss_cloak_interval = F1_0*10; // Time between cloaks
|
||||
}
|
||||
namespace dcx {
|
||||
fix64 Last_gate_time = 0;
|
||||
fix64 Last_gate_time;
|
||||
static fix64 Boss_dying_start_time;
|
||||
fix Gate_interval = F1_0*6;
|
||||
sbyte Boss_dying, Boss_dying_sound_playing, Boss_hit_this_frame;
|
||||
|
@ -475,7 +475,7 @@ void ai_init_boss_for_ship(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
void boss_init_all_segments(const object &boss_objnum)
|
||||
static void boss_init_all_segments(const object &boss_objnum)
|
||||
{
|
||||
if (!Boss_teleport_segs.empty())
|
||||
return; // already have boss segs
|
||||
|
@ -568,7 +568,12 @@ void init_ai_object(vmobjptridx_t objp, ai_behavior behavior, const imsegidx_t h
|
|||
&& !EditorWindow
|
||||
#endif
|
||||
)
|
||||
{
|
||||
Last_gate_time = 0;
|
||||
Last_teleport_time = 0;
|
||||
Boss_cloak_start_time = 0;
|
||||
boss_init_all_segments(objp);
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue