Project

General

Profile

Feature #967 ยป 0038-Unhardcode-wld.map-from-can_city_build_direct.patch

Marko Lindqvist, 10/15/2024 09:44 PM

View differences:

client/citydlg_common.c
struct universal old = pcity->production;
/* Insert as current production. */
if (!can_city_build_direct(pcity, item)) {
if (!can_city_build_direct(&(wld.map), pcity, item)) {
return FALSE;
}
common/city.c
Returns whether city can immediately build given target,
unit or improvement. This considers obsolete targets still buildable.
**************************************************************************/
bool can_city_build_direct(const struct city *pcity,
bool can_city_build_direct(const struct civ_map *nmap,
const struct city *pcity,
const struct universal *target)
{
const struct civ_map *nmap = &(wld.map);
switch (target->kind) {
case VUT_UTYPE:
return can_city_build_unit_direct(nmap, pcity, target->value.utype);
common/city.h
const struct city *pcity,
const struct unit_type *punittype);
bool can_city_build_direct(const struct city *pcity,
bool can_city_build_direct(const struct civ_map *nmap,
const struct city *pcity,
const struct universal *target);
bool can_city_build_later(const struct city *pcity,
const struct universal *target);
    (1-1/1)