Fix ugly hack of using -4 for fuelcen reached

This commit is contained in:
Kp 2012-12-08 21:28:59 +00:00
parent ae88d2ed8b
commit 85b95efc70
3 changed files with 10 additions and 3 deletions

View file

@ -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);

View file

@ -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)) {

View file

@ -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) {