Fold escort_set_goal_object calls to exists_in_mine
This commit is contained in:
parent
ad35460eb0
commit
03b0222896
|
@ -842,13 +842,19 @@ static escort_goal_t escort_set_goal_object(const player_flags pl_flags)
|
||||||
{
|
{
|
||||||
if (Escort_special_goal != ESCORT_GOAL_UNSPECIFIED)
|
if (Escort_special_goal != ESCORT_GOAL_UNSPECIFIED)
|
||||||
return ESCORT_GOAL_UNSPECIFIED;
|
return ESCORT_GOAL_UNSPECIFIED;
|
||||||
if (!(pl_flags & PLAYER_FLAGS_BLUE_KEY) && (exists_in_mine(ConsoleObject->segnum, OBJ_POWERUP, POW_KEY_BLUE, -1) != object_none))
|
powerup_type_t keyid;
|
||||||
return ESCORT_GOAL_BLUE_KEY;
|
escort_goal_t goal;
|
||||||
else if (!(pl_flags & PLAYER_FLAGS_GOLD_KEY) && (exists_in_mine(ConsoleObject->segnum, OBJ_POWERUP, POW_KEY_GOLD, -1) != object_none))
|
if (
|
||||||
return ESCORT_GOAL_GOLD_KEY;
|
(!(pl_flags & PLAYER_FLAGS_BLUE_KEY) && (keyid = POW_KEY_BLUE, goal = ESCORT_GOAL_BLUE_KEY, true)) ||
|
||||||
else if (!(pl_flags & PLAYER_FLAGS_RED_KEY) && (exists_in_mine(ConsoleObject->segnum, OBJ_POWERUP, POW_KEY_RED, -1) != object_none))
|
(!(pl_flags & PLAYER_FLAGS_GOLD_KEY) && (keyid = POW_KEY_GOLD, goal = ESCORT_GOAL_GOLD_KEY, true)) ||
|
||||||
return ESCORT_GOAL_RED_KEY;
|
(!(pl_flags & PLAYER_FLAGS_RED_KEY) && (keyid = POW_KEY_RED, goal = ESCORT_GOAL_RED_KEY, true))
|
||||||
else if (Control_center_destroyed == 0) {
|
)
|
||||||
|
{
|
||||||
|
if (exists_in_mine(ConsoleObject->segnum, OBJ_POWERUP, keyid, -1) != object_none)
|
||||||
|
return goal;
|
||||||
|
}
|
||||||
|
if (Control_center_destroyed == 0)
|
||||||
|
{
|
||||||
if (Boss_teleport_segs.count())
|
if (Boss_teleport_segs.count())
|
||||||
return ESCORT_GOAL_BOSS;
|
return ESCORT_GOAL_BOSS;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue