diff --git a/common/main/ai.h b/common/main/ai.h index 7ee2940d6..8e89add6b 100644 --- a/common/main/ai.h +++ b/common/main/ai.h @@ -232,7 +232,6 @@ extern objnum_t Escort_goal_index; #define THIEF_PROBABILITY 16384 // 50% chance of stealing an item at each attempt -extern int Escort_kill_object; // Maximum number kept track of, will keep stealing, causes stolen weapons to be lost! struct stolen_items_t : public array {}; extern stolen_items_t Stolen_items; diff --git a/d2x-rebirth/main/escort.cpp b/d2x-rebirth/main/escort.cpp index e4d5fafaa..c3dcaffee 100644 --- a/d2x-rebirth/main/escort.cpp +++ b/d2x-rebirth/main/escort.cpp @@ -110,7 +110,6 @@ constexpr array Escort_goal_text = {{ }}; static int Max_escort_length = 200; -int Escort_kill_object = -1; stolen_items_t Stolen_items; int Stolen_item_index; fix64 Escort_last_path_created = 0; @@ -744,8 +743,6 @@ static void escort_create_path_to_goal(const vmobjptridx_t objp, const player_in if (Escort_special_goal != ESCORT_GOAL_UNSPECIFIED) Escort_goal_object = Escort_special_goal; - Escort_kill_object = -1; - const auto powerup_flags = player_info.powerup_flags; if (Looking_for_marker != -1) { goal_seg = escort_get_goal_segment(objp, OBJ_MARKER, Escort_goal_object - ESCORT_GOAL_MARKER1, powerup_flags); diff --git a/similar/main/ai.cpp b/similar/main/ai.cpp index 1fa69fe71..5cda71164 100644 --- a/similar/main/ai.cpp +++ b/similar/main/ai.cpp @@ -521,7 +521,6 @@ void init_ai_object(vmobjptridx_t objp, ai_behavior behavior, const imsegidx_t h #if defined(DXX_BUILD_DESCENT_II) if (robot_is_companion(robptr)) { ailp->mode = ai_mode::AIM_GOTO_PLAYER; - Escort_kill_object = -1; } if (robot_is_thief(robptr)) { @@ -4494,7 +4493,7 @@ int ai_save_state(PHYSFS_File *fp) else tmptime32 = Boss_hit_time - GameTime64; PHYSFS_write(fp, &tmptime32, sizeof(fix), 1); - PHYSFS_write(fp, &Escort_kill_object, sizeof(Escort_kill_object), 1); + PHYSFS_writeSLE32(fp, -1); if (Escort_last_path_created - GameTime64 < F1_0*(-18000)) tmptime32 = F1_0*(-18000); else @@ -4691,7 +4690,7 @@ int ai_restore_state(PHYSFS_File *fp, int version, int swap) Boss_hit_time = static_cast(tmptime32); if (version >= 8) { - Escort_kill_object = PHYSFSX_readSXE32(fp, swap); + PHYSFSX_readSXE32(fp, swap); tmptime32 = PHYSFSX_readSXE32(fp, swap); Escort_last_path_created = static_cast(tmptime32); Escort_goal_object = static_cast(PHYSFSX_readSXE32(fp, swap)); @@ -4699,7 +4698,6 @@ int ai_restore_state(PHYSFS_File *fp, int version, int swap) Escort_goal_index = PHYSFSX_readSXE32(fp, swap); PHYSFS_read(fp, &Stolen_items, sizeof(Stolen_items[0]) * Stolen_items.size(), 1); } else { - Escort_kill_object = -1; Escort_last_path_created = 0; Escort_goal_object = ESCORT_GOAL_UNSPECIFIED; Escort_special_goal = ESCORT_GOAL_UNSPECIFIED;