Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize order.sub_target in path_finder #2421

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/path_finder.cpp
Original file line number Diff line number Diff line change
@@ -48,6 +48,7 @@ vertex vertex::child_for_action(action_id action, const unit &probe,
ret.order.order = ORDER_PERFORM_ACTION;
ret.order.action = action;
ret.order.target = target->index;
ret.order.sub_target = NO_TARGET;
ret.order.dir = DIR8_ORIGIN;
ret.moves_left = probe.moves_left;
ret.location = target;
6 changes: 3 additions & 3 deletions server/savegame/savegame3.cpp
Original file line number Diff line number Diff line change
@@ -6035,14 +6035,14 @@ static bool sg_load_player_unit(struct loaddata *loading, struct player *plr,
break;
case ASTK_NONE:
// None of these can take a sub target.
fc_assert_msg(order_sub_tgt == -1,
fc_assert_msg(order_sub_tgt == NO_TARGET,
"Specified sub target for action %d unsupported.",
order->action);
order->sub_target = NO_TARGET;
break;
case ASTK_COUNT:
fc_assert_msg(order_sub_tgt == -1, "Bad action action %d.",
order->action);
fc_assert_msg(order_sub_tgt == NO_TARGET,
"Bad action action %d.", order->action);
order->sub_target = NO_TARGET;
break;
}