From f1ddfd448a7bf8a046419b163fb6da3e8f9ac216 Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 2 Dec 2012 04:59:42 +0000 Subject: [PATCH] Simplify search for guide bot in escort menu --- d2x-rebirth/main/escort.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/d2x-rebirth/main/escort.cpp b/d2x-rebirth/main/escort.cpp index 98d09a181..3e4405917 100644 --- a/d2x-rebirth/main/escort.cpp +++ b/d2x-rebirth/main/escort.cpp @@ -1688,25 +1688,16 @@ void do_escort_menu(void) return; } - for (i=0; i<=Highest_object_index; i++) { + for (i=0;; i++) { + if (!(i <= Highest_object_index)) { + HUD_init_message_literal(HM_DEFAULT, "No Guide-Bot present in mine!"); + return; + } if (Objects[i].type == OBJ_ROBOT) if (Robot_info[get_robot_id(&Objects[i])].companion) break; } - if (i > Highest_object_index) { - - HUD_init_message_literal(HM_DEFAULT, "No Guide-Bot present in mine!"); - - #if 0 //ndef NDEBUG // Just use HELPVISHNU!! - // If no buddy bot, create one! - HUD_init_message(HM_DEFAULT, "Debug Version: Creating Guide-Bot!"); - create_buddy_bot(); - #else - return; - #endif - } - ok_for_buddy_to_talk(); // Needed here or we might not know buddy can talk when he can. if (!Buddy_allowed_to_talk) {