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 #905143 » 0022-Inline-is_city_center.patch
common/city.c | ||
---|---|---|
3425 | 3425 |
return pcity != game_city_by_number(pcity->id); |
3426 | 3426 |
} |
3427 | 3427 | |
3428 |
/************************************************************************** |
|
3429 |
Return TRUE if the city is centered at the given tile. |
|
3430 | ||
3431 |
NB: This doesn't simply check whether pcity->tile == ptile because that |
|
3432 |
would miss virtual clones made of city center tiles, which are used by |
|
3433 |
autosettler to judge whether improvements are worthwhile. The upshot is |
|
3434 |
that city centers would appear to lose their irrigation/farmland bonuses |
|
3435 |
as well as their minimum outputs of one food and one shield, and thus |
|
3436 |
autosettler would rarely transform or mine them. |
|
3437 |
**************************************************************************/ |
|
3438 |
bool is_city_center(const struct city *pcity, const struct tile *ptile) |
|
3439 |
{ |
|
3440 |
if (!pcity || !pcity->tile || !ptile) { |
|
3441 |
return FALSE; |
|
3442 |
} |
|
3443 | ||
3444 |
return tile_index(city_tile(pcity)) == tile_index(ptile); |
|
3445 |
} |
|
3446 | ||
3447 | 3428 |
/************************************************************************** |
3448 | 3429 |
Return TRUE if the city is worked without using up a citizen. |
3449 | 3430 |
**************************************************************************/ |
common/city.h | ||
---|---|---|
25 | 25 |
#include "fc_types.h" |
26 | 26 |
#include "name_translation.h" |
27 | 27 |
#include "improvement.h" |
28 |
#include "tile.h" |
|
28 | 29 |
#include "traderoutes.h" |
29 | 30 |
#include "unitlist.h" |
30 | 31 |
#include "vision.h" |
... | ... | |
756 | 757 | |
757 | 758 |
/* === */ |
758 | 759 | |
759 |
bool is_city_center(const struct city *pcity, const struct tile *ptile); |
|
760 |
/************************************************************************** |
|
761 |
Return TRUE if the city is centered at the given tile. |
|
762 | ||
763 |
NB: This doesn't simply check whether pcity->tile == ptile because that |
|
764 |
would miss virtual clones made of city center tiles, which are used by |
|
765 |
autosettler to judge whether improvements are worthwhile. The upshot is |
|
766 |
that city centers would appear to lose their irrigation/farmland bonuses |
|
767 |
as well as their minimum outputs of one food and one shield, and thus |
|
768 |
autosettler would rarely transform or mine them. |
|
769 |
**************************************************************************/ |
|
770 |
static inline bool is_city_center(const struct city *pcity, |
|
771 |
const struct tile *ptile) |
|
772 |
{ |
|
773 |
if (!pcity || !pcity->tile || !ptile) { |
|
774 |
return FALSE; |
|
775 |
} |
|
776 | ||
777 |
return tile_index(city_tile(pcity)) == tile_index(ptile); |
|
778 |
} |
|
779 | ||
760 | 780 |
bool is_free_worked(const struct city *pcity, const struct tile *ptile); |
761 | 781 | |
762 | 782 |
#define is_free_worked_index(city_tile_index) \ |
common/generate_packets.py | ||
---|---|---|
1903 | 1903 | |
1904 | 1904 |
/* common */ |
1905 | 1905 |
#include "actions.h" |
1906 |
#include "city.h" |
|
1906 | 1907 |
#include "disaster.h" |
1907 | 1908 | |
1908 | 1909 |
''') |
common/player.h | ||
---|---|---|
21 | 21 |
#include "bitvector.h" |
22 | 22 | |
23 | 23 |
/* common */ |
24 |
#include "city.h" |
|
25 | 24 |
#include "connection.h" |
26 | 25 |
#include "effects.h" |
27 | 26 |
#include "fc_types.h" |
... | ... | |
35 | 34 |
#include "unitlist.h" |
36 | 35 |
#include "vision.h" |
37 | 36 | |
37 |
struct city; |
|
38 | ||
38 | 39 |
#define PLAYER_DEFAULT_TAX_RATE 0 |
39 | 40 |
#define PLAYER_DEFAULT_SCIENCE_RATE 100 |
40 | 41 |
#define PLAYER_DEFAULT_LUXURY_RATE 0 |
41 |
- |