Author: sveinung Date: Wed May 11 18:50:53 2016 New Revision: 32670 URL: http://svn.gna.org/viewcvs/freeciv?rev=32670&view=rev Log: Action not enabled explain unknown target tile.
See patch #7212 Modified: trunk/server/unithand.c trunk/server/unittools.c Modified: trunk/server/unithand.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=32670&r1=32669&r2=32670&view=diff ============================================================================== --- trunk/server/unithand.c (original) +++ trunk/server/unithand.c Wed May 11 18:50:53 2016 @@ -120,6 +120,8 @@ ANEK_CITY_POP_LIMIT, /* Explanation: the specified city don't have the needed capacity. */ ANEK_CITY_NO_CAPACITY, + /* Explanation: the target tile is unknown. */ + ANEK_TGT_TILE_UNKNOWN, /* Explanation: the action is blocked by another action. */ ANEK_ACTION_BLOCKS, /* Explanation not detected. */ @@ -910,6 +912,10 @@ } else if (action_id == ACTION_FOUND_CITY && action_custom == CB_NO_MIN_DIST) { explnat->kind = ANEK_CITY_TOO_CLOSE_TGT; + } else if (action_id == ACTION_PARADROP + && target_tile + && !map_is_known(target_tile, unit_owner(punit))) { + explnat->kind = ANEK_TGT_TILE_UNKNOWN; } else if ((game.scenario.prevent_new_cities && utype_can_do_action(unit_type_get(punit), ACTION_FOUND_CITY)) && (action_id == ACTION_FOUND_CITY @@ -1064,6 +1070,12 @@ _("%s don't have enough capacity, so " "%s cannot do anything."), city_name_get(explnat->capacity_city), + unit_name_translation(punit)); + break; + case ANEK_TGT_TILE_UNKNOWN: + notify_player(pplayer, target_tile, E_BAD_COMMAND, ftc_server, + /* TRANS: Paratroopers ... */ + _("%s can't do anything to an unknown target tile."), unit_name_translation(punit)); break; case ANEK_ACTION_BLOCKS: @@ -1447,6 +1459,14 @@ city_name_get(explnat->capacity_city), action_get_ui_name(stopped_action), unit_name_translation(actor)); + break; + case ANEK_TGT_TILE_UNKNOWN: + notify_player(pplayer, unit_tile(actor), + event, ftc_server, + /* TRANS: Paratroopers ... Drop Paratrooper */ + _("%s can't do %s to an unknown tile."), + unit_name_translation(actor), + action_get_ui_name(stopped_action)); break; case ANEK_ACTION_BLOCKS: notify_player(pplayer, unit_tile(actor), Modified: trunk/server/unittools.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/unittools.c?rev=32670&r1=32669&r2=32670&view=diff ============================================================================== --- trunk/server/unittools.c (original) +++ trunk/server/unittools.c Wed May 11 18:50:53 2016 @@ -2694,13 +2694,6 @@ struct player *pplayer = unit_owner(punit); int range, distance; - if (!map_is_known(ptile, pplayer)) { - /* TODO: Explain using the action not enabled system and remove. */ - notify_player(pplayer, ptile, E_BAD_COMMAND, ftc_server, - _("The destination location is not known.")); - return FALSE; - } - range = unit_type_get(punit)->paratroopers_range; distance = real_map_distance(unit_tile(punit), ptile); if (distance > range) { _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits