From 850853326cf1320391557af0227cebbd1b96cd12 Mon Sep 17 00:00:00 2001 From: Kp Date: Thu, 28 May 2015 03:08:39 +0000 Subject: [PATCH] Pass vsegptridx to gate_in_robot --- common/main/ai.h | 2 +- similar/main/ai.cpp | 3 +-- similar/main/multibot.cpp | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/common/main/ai.h b/common/main/ai.h index 9b3b3c0ed..69f77761d 100644 --- a/common/main/ai.h +++ b/common/main/ai.h @@ -101,7 +101,7 @@ extern sbyte Boss_dying; extern vms_vector Believed_player_pos; void move_towards_segment_center(vobjptr_t objp); -extern objptridx_t gate_in_robot(int type, segnum_t segnum); +objptridx_t gate_in_robot(int type, vsegptridx_t segnum); void do_ai_frame(vobjptridx_t objp); void init_ai_object(vobjptr_t objp, ai_behavior initial_mode, segnum_t hide_segment); extern void do_ai_frame_all(void); diff --git a/similar/main/ai.cpp b/similar/main/ai.cpp index 81c12f220..6a7148c7f 100644 --- a/similar/main/ai.cpp +++ b/similar/main/ai.cpp @@ -1991,9 +1991,8 @@ static objptridx_t create_gated_robot(const vsegptridx_t segp, int object_id, co // The process of him bringing in a robot takes one second. // Then a robot appears somewhere near the player. // Return objnum if robot successfully created, else return -1 -objptridx_t gate_in_robot(int type, segnum_t segnum) +objptridx_t gate_in_robot(int type, const vsegptridx_t segnum) { - Assert((segnum >= 0) && (segnum <= Highest_segment_index)); return create_gated_robot(segnum, type, NULL); } diff --git a/similar/main/multibot.cpp b/similar/main/multibot.cpp index d713f2342..fa75cf248 100644 --- a/similar/main/multibot.cpp +++ b/similar/main/multibot.cpp @@ -1044,13 +1044,13 @@ void multi_do_boss_create_robot(const playernum_t pnum, const ubyte *buf) return; } // Do some validity checking - if ( (b.objrobot >= MAX_OBJECTS) || (b.objrobot < 0) || (b.where < 0) || (b.where > Highest_segment_index) ) + if (b.objrobot >= MAX_OBJECTS || b.objrobot < 0) { Int3(); // See Rob, bad data in boss gate action message return; } // Gate one in! - if (gate_in_robot(b.robot_type, b.where) != object_none) + if (gate_in_robot(b.robot_type, vsegptridx(b.where)) != object_none) map_objnum_local_to_remote(Net_create_objnums[0], b.objrobot, pnum); }