diff --git a/common/main/escort.h b/common/main/escort.h index 0bced469e..2c09eb2a7 100644 --- a/common/main/escort.h +++ b/common/main/escort.h @@ -25,6 +25,7 @@ struct object; extern void change_guidebot_name(void); extern void do_escort_menu(void); extern void detect_escort_goal_accomplished(int index); +void detect_escort_goal_fuelcen_accomplished(); extern void set_escort_special_goal(int key); void recreate_thief(struct object *objp); void init_buddy_for_level(void); diff --git a/d2x-rebirth/main/escort.cpp b/d2x-rebirth/main/escort.cpp index 61a952aeb..d8656b5ad 100644 --- a/d2x-rebirth/main/escort.cpp +++ b/d2x-rebirth/main/escort.cpp @@ -304,6 +304,14 @@ static void record_escort_goal_accomplished() } // -------------------------------------------------------------------------------------------- +void detect_escort_goal_fuelcen_accomplished() +{ + if (!Buddy_allowed_to_talk) + return; + if (Escort_special_goal == ESCORT_GOAL_ENERGYCEN) + record_escort_goal_accomplished(); +} + void detect_escort_goal_accomplished(int index) { if (!Buddy_allowed_to_talk) @@ -344,8 +352,6 @@ if ((Escort_goal_index <= ESCORT_GOAL_RED_KEY) && (index >= 0)) { if (Escort_special_goal != -1) { if (Escort_special_goal == ESCORT_GOAL_ENERGYCEN) { - if (index == -4) - record_escort_goal_accomplished(); } else if ((Objects[index].type == OBJ_POWERUP) && (Escort_special_goal == ESCORT_GOAL_POWERUP)) record_escort_goal_accomplished(); // Any type of powerup picked up will do. else if ((Objects[index].type == Objects[Escort_goal_index].type) && (Objects[index].id == Objects[Escort_goal_index].id)) { diff --git a/similar/main/fuelcen.cpp b/similar/main/fuelcen.cpp index 40b8a0a75..f0d9f8bfc 100644 --- a/similar/main/fuelcen.cpp +++ b/similar/main/fuelcen.cpp @@ -579,7 +579,7 @@ fix fuelcen_give_fuel(segment *segp, fix MaxAmountCanTake ) fix amount; #if defined(DXX_BUILD_DESCENT_II) - detect_escort_goal_accomplished(-4); // UGLY! Hack! -4 means went through fuelcen. + detect_escort_goal_fuelcen_accomplished(); #endif // if (Station[segp->value].MaxCapacity<=0) {