#45938: City-buy allows buying off all shields of an unavailable production target Open Date: 2022-10-20 20:17 Last Update: 2022-10-20 22:21 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/45938 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=45938 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2022-10-20 22:21 Updated by: alienvalkyrie Comment: Reply To cazfi But likely to have a rule that "buying something *known* to be unavailable is prohibited even if one can buy something that later turns out to be unavailable", would be an improvement over current rule that "buying is allowed on both cases"? It would certainly help prevent potential mistakes for beginners, but it might cause a situation where having more information (in a way the game understands) would take away possible courses of action (i.e. buying something unavailable). If we don't want that, we could show a warning instead of downright prohibiting it. --------------------------------------------------------------------- Ticket Status: Reporter: (Anonymous) Owner: (None) Type: Bugs Status: Open Priority: 5 - Medium MileStone: (None) Component: (None) Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: Unavailable production targets DO happen (probably shouldn't), but that's a separate issue. This bug happens when there is an unavailable target in current city production. It is still possible to buy the target. This facilitated exploits like (rather) tricky worklist manipulations to arrive at illegal targets so that one can buy them at lower shield-gold cost, then switch the target on the next turn from some unit costing 10 or 20 to one cost 30 or 40. Adding a check for unavailability in really_handle_city_buy() fixed it for us at FCW: /* City with an illegal target! Don't allow illegal-buy exploits: */ if (!can_city_build_direct(pcity, &pcity->production)) { char prod[256]; universal_name_translation(&pcity->production, prod, sizeof(prod)); notify_player(pplayer, pcity->tile, E_BAD_COMMAND, ftc_server, _("[`no`] %s lacks requirements to buy or build %s."), city_link(pcity), prod); return; } -- Ticket information of Freeciv project Freeciv Project is hosted on OSDN Project URL: https://osdn.net/projects/freeciv/ OSDN: https://osdn.net URL for this Ticket: https://osdn.net/projects/freeciv/ticket/45938 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=45938