Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. *Read more...*

Feature #782589 ยป 0001-Some-actions-needs-an-extra-sub-target.patch

Sveinung Kvilhaugsvik, 2018-10-29 08:11 AM

View differences:

server/savegame3.c
case ACTION_IRRIGATE:
/* These take an extra. */
action_wants_extra = TRUE;
/* FIXME: Validate that an extra target is there when
* expected. */
break;
case ACTION_ESTABLISH_EMBASSY:
case ACTION_ESTABLISH_EMBASSY_STAY:
......
}
}
if (order->order == ORDER_ACTIVITY || action_wants_extra) {
enum unit_activity act;
if (order_sub_tgt < 0 || order_sub_tgt >= loading->extra.size) {
if (order_sub_tgt != EXTRA_NONE) {
log_sg("Cannot find extra %d for %s to build",
......
} else {
order->sub_target = order_sub_tgt;
}
/* An action or an activity may require an extra target. */
if (action_wants_extra) {
act = action_id_get_activity(order->action);
} else {
act = order->activity;
}
if (unit_activity_is_valid(act)
&& unit_activity_needs_target_from_client(act)
&& order->sub_target == EXTRA_NONE) {
/* Missing required action extra target. */
free(punit->orders.list);
punit->orders.list = NULL;
punit->has_orders = FALSE;
}
}
}
} else {
server/unithand.c
} else {
target_extra = NULL;
}
/* FIXME: Validate that an extra target is there when expected. */
paction = action_by_number(action_type);
if (action_get_activity(paction) != ACTIVITY_LAST
&& unit_activity_needs_target_from_client(
action_get_activity(paction))
&& target_extra == NULL) {
/* Missing required action extra target. */
log_verbose("unit_perform_action() action %d requires action "
"but extra id %d is invalid.",
action_type, sub_tgt_id);
return FALSE;
}
if (NULL == actor_unit) {
/* Probably died or bribed. */
log_verbose("handle_unit_do_action() invalid actor %d",
    (1-1/1)