From 7dae02fbb480cd78b320ad6106718358620c7d21 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 9 May 2015 17:39:00 +0000 Subject: [PATCH] Remove write-only ai_static D1 follow_path_end_seg --- common/main/aistruct.h | 1 - similar/editor/medrobot.cpp | 1 - similar/main/gamesave.cpp | 5 ++--- similar/main/multi.cpp | 3 +-- similar/main/object.cpp | 1 - similar/main/state.cpp | 3 +-- 6 files changed, 4 insertions(+), 10 deletions(-) diff --git a/common/main/aistruct.h b/common/main/aistruct.h index ad85aff81..338bd4ea9 100644 --- a/common/main/aistruct.h +++ b/common/main/aistruct.h @@ -212,7 +212,6 @@ struct ai_static : public prohibit_void_ptr #if defined(DXX_BUILD_DESCENT_I) short cur_path_index; // Current index in path. segnum_t follow_path_start_seg; // Start segment for robot which follows path. - segnum_t follow_path_end_seg; // End segment for robot which follows path. #elif defined(DXX_BUILD_DESCENT_II) sbyte cur_path_index; // Current index in path. sbyte dying_sound_playing; // !0 if this robot is playing its dying sound. diff --git a/similar/editor/medrobot.cpp b/similar/editor/medrobot.cpp index 49f68ebae..c746f83c3 100644 --- a/similar/editor/medrobot.cpp +++ b/similar/editor/medrobot.cpp @@ -98,7 +98,6 @@ static void call_init_ai_object(const vobjptr_t objp, ai_behavior behavior) if (behavior == ai_behavior::AIB_STATION) { #if defined(DXX_BUILD_DESCENT_I) objp->ctype.ai_info.follow_path_start_seg = Cursegp-Segments; - objp->ctype.ai_info.follow_path_end_seg = Markedsegp-Segments; #endif } } diff --git a/similar/main/gamesave.cpp b/similar/main/gamesave.cpp index 2e8059790..9ba3cb6b0 100644 --- a/similar/main/gamesave.cpp +++ b/similar/main/gamesave.cpp @@ -433,11 +433,10 @@ static void read_object(const vobjptr_t obj,PHYSFS_file *f,int version) if (version <= 25) { #if defined(DXX_BUILD_DESCENT_I) obj->ctype.ai_info.follow_path_start_seg = PHYSFSX_readShort(f); - obj->ctype.ai_info.follow_path_end_seg = PHYSFSX_readShort(f); #elif defined(DXX_BUILD_DESCENT_II) PHYSFSX_readShort(f); // obj->ctype.ai_info.follow_path_start_seg = - PHYSFSX_readShort(f); // obj->ctype.ai_info.follow_path_end_seg = #endif + PHYSFSX_readShort(f); // obj->ctype.ai_info.follow_path_end_seg = } break; @@ -674,7 +673,7 @@ static void write_object(const vcobjptr_t obj, short version, PHYSFS_file *f) #if defined(DXX_BUILD_DESCENT_I) PHYSFS_writeSLE16(f, obj->ctype.ai_info.follow_path_start_seg); - PHYSFS_writeSLE16(f, obj->ctype.ai_info.follow_path_end_seg); + PHYSFS_writeSLE16(f, segment_none); #elif defined(DXX_BUILD_DESCENT_II) if (version <= 25) { diff --git a/similar/main/multi.cpp b/similar/main/multi.cpp index 5bcf4ac54..c4c6339e1 100644 --- a/similar/main/multi.cpp +++ b/similar/main/multi.cpp @@ -5377,7 +5377,7 @@ void multi_object_to_object_rw(const vobjptr_t obj, object_rw *obj_rw) obj_rw->ctype.ai_info.danger_laser_signature = obj->ctype.ai_info.danger_laser_signature.get(); #if defined(DXX_BUILD_DESCENT_I) obj_rw->ctype.ai_info.follow_path_start_seg = obj->ctype.ai_info.follow_path_start_seg; - obj_rw->ctype.ai_info.follow_path_end_seg = obj->ctype.ai_info.follow_path_end_seg; + obj_rw->ctype.ai_info.follow_path_end_seg = segment_none; #elif defined(DXX_BUILD_DESCENT_II) obj_rw->ctype.ai_info.dying_sound_playing = obj->ctype.ai_info.dying_sound_playing; if (obj->ctype.ai_info.dying_start_time == 0) // if bot not dead, anything but 0 will kill it @@ -5545,7 +5545,6 @@ void multi_object_rw_to_object(object_rw *obj_rw, const vobjptr_t obj) obj->ctype.ai_info.danger_laser_signature = object_signature_t{static_cast(obj_rw->ctype.ai_info.danger_laser_signature)}; #if defined(DXX_BUILD_DESCENT_I) obj->ctype.ai_info.follow_path_start_seg = obj_rw->ctype.ai_info.follow_path_start_seg; - obj->ctype.ai_info.follow_path_end_seg = obj_rw->ctype.ai_info.follow_path_end_seg; #elif defined(DXX_BUILD_DESCENT_II) obj->ctype.ai_info.dying_sound_playing = obj_rw->ctype.ai_info.dying_sound_playing; obj->ctype.ai_info.dying_start_time = obj_rw->ctype.ai_info.dying_start_time; diff --git a/similar/main/object.cpp b/similar/main/object.cpp index 1b98371e0..d54dae40b 100644 --- a/similar/main/object.cpp +++ b/similar/main/object.cpp @@ -2256,7 +2256,6 @@ void object_rw_swap(object_rw *obj, int swap) #if defined(DXX_BUILD_DESCENT_I) obj->ctype.ai_info.cur_path_index = SWAPSHORT(obj->ctype.ai_info.cur_path_index); obj->ctype.ai_info.follow_path_start_seg = SWAPSHORT(obj->ctype.ai_info.follow_path_start_seg); - obj->ctype.ai_info.follow_path_end_seg = SWAPSHORT(obj->ctype.ai_info.follow_path_end_seg); #elif defined(DXX_BUILD_DESCENT_II) obj->ctype.ai_info.dying_start_time = SWAPINT(obj->ctype.ai_info.dying_start_time); #endif diff --git a/similar/main/state.cpp b/similar/main/state.cpp index d2a043abf..3c6fbcc9d 100644 --- a/similar/main/state.cpp +++ b/similar/main/state.cpp @@ -224,7 +224,7 @@ static void state_object_to_object_rw(const vcobjptr_t obj, object_rw *obj_rw) obj_rw->ctype.ai_info.danger_laser_signature = obj->ctype.ai_info.danger_laser_signature.get(); #if defined(DXX_BUILD_DESCENT_I) obj_rw->ctype.ai_info.follow_path_start_seg = obj->ctype.ai_info.follow_path_start_seg; - obj_rw->ctype.ai_info.follow_path_end_seg = obj->ctype.ai_info.follow_path_end_seg; + obj_rw->ctype.ai_info.follow_path_end_seg = segment_none; #elif defined(DXX_BUILD_DESCENT_II) obj_rw->ctype.ai_info.dying_sound_playing = obj->ctype.ai_info.dying_sound_playing; if (obj->ctype.ai_info.dying_start_time == 0) // if bot not dead, anything but 0 will kill it @@ -394,7 +394,6 @@ static void state_object_rw_to_object(object_rw *obj_rw, const vobjptr_t obj) obj->ctype.ai_info.danger_laser_signature = object_signature_t{static_cast(obj_rw->ctype.ai_info.danger_laser_signature)}; #if defined(DXX_BUILD_DESCENT_I) obj->ctype.ai_info.follow_path_start_seg = obj_rw->ctype.ai_info.follow_path_start_seg; - obj->ctype.ai_info.follow_path_end_seg = obj_rw->ctype.ai_info.follow_path_end_seg; #elif defined(DXX_BUILD_DESCENT_II) obj->ctype.ai_info.dying_sound_playing = obj_rw->ctype.ai_info.dying_sound_playing; obj->ctype.ai_info.dying_start_time = obj_rw->ctype.ai_info.dying_start_time;