From cba2c42e491fb2067aba0cd3a538e44f1ef89179 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Mon, 22 Mar 2021 14:44:37 +0100 Subject: [PATCH] do_paradrop(): trust the action system. Trust that the action sent is correct when determining if a city conquest is legal or not in the action performer of the paradrop actions. See osdn #41827 --- server/unittools.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/server/unittools.c b/server/unittools.c index 36a4801cf5..b6d5d3509d 100644 --- a/server/unittools.c +++ b/server/unittools.c @@ -2866,7 +2866,8 @@ bool do_paradrop(struct unit *punit, struct tile *ptile, if (NULL != plrtile->site && plrtile->owner != NULL - && pplayers_non_attack(pplayer, plrtile->owner)) { + && !pplayers_allied(pplayer, plrtile->owner) + && !action_has_result(paction, ACTRES_PARADROP_CONQUER)) { notify_player(pplayer, ptile, E_BAD_COMMAND, ftc_server, _("Cannot attack unless you declare war first.")); return FALSE; @@ -2890,12 +2891,8 @@ bool do_paradrop(struct unit *punit, struct tile *ptile, return TRUE; } - if (is_non_attack_city_tile(ptile, pplayer) - || (is_non_allied_city_tile(ptile, pplayer) - && (pplayer->ai_common.barbarian_type == ANIMAL_BARBARIAN - || !uclass_has_flag(unit_class_get(punit), - UCF_CAN_OCCUPY_CITY) - || unit_has_type_flag(punit, UTYF_CIVILIAN))) + if ((is_non_allied_city_tile(ptile, pplayer) + && !action_has_result(paction, ACTRES_PARADROP_CONQUER)) || is_non_allied_unit_tile(ptile, pplayer)) { map_show_circle(pplayer, ptile, unit_type_get(punit)->vision_radius_sq); maybe_make_contact(ptile, pplayer); -- 2.20.1