Freeciv-3.1
Loading...
Searching...
No Matches
cityhand.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <stdio.h>
19#include <stdlib.h>
20#include <string.h>
21
22/* utility */
23#include "capability.h"
24#include "fcintl.h"
25#include "log.h"
26#include "mem.h"
27#include "rand.h"
28#include "support.h"
29
30/* common */
31#include "city.h"
32#include "events.h"
33#include "game.h"
34#include "idex.h"
35#include "map.h"
36#include "player.h"
37#include "specialist.h"
38#include "unit.h"
39#include "worklist.h"
40
41/* common/aicore */
42#include "cm.h"
43
44/* server */
45#include "citytools.h"
46#include "cityturn.h"
47#include "notify.h"
48#include "plrhand.h"
49#include "sanitycheck.h"
50#include "unithand.h"
51#include "unittools.h"
52
53#include "cityhand.h"
54
55/**********************************************************************/
60void handle_city_name_suggestion_req(struct player *pplayer, int unit_id16,
61 int unit_id32)
62{
63 struct unit *punit;
64 const struct civ_map *nmap = &(wld.map);
65
66 if (!has_capability("ids32", pplayer->current_conn->capability)) {
67 unit_id32 = unit_id16;
68 }
69
70 punit = player_unit_by_number(pplayer, unit_id32);
71
72 if (NULL == punit) {
73 /* Probably died or bribed. */
74 log_verbose("handle_city_name_suggestion_req() invalid unit %d",
75 unit_id32);
76 return;
77 }
78
79 if (action_prob_possible(action_prob_vs_tile(nmap, punit, ACTION_FOUND_CITY,
80 unit_tile(punit), NULL))) {
81 log_verbose("handle_city_name_suggest_req(unit_pos (%d, %d))",
84 unit_id32, unit_id32,
86
87 /* The rest of this function is error handling. */
88 return;
89 }
90
91 log_verbose("handle_city_name_suggest_req(unit_pos (%d, %d)): "
92 "cannot build there.", TILE_XY(unit_tile(punit)));
93
94 illegal_action_msg(pplayer, E_BAD_COMMAND, punit, ACTION_FOUND_CITY,
95 unit_tile(punit), NULL, NULL);
96}
97
98/**********************************************************************/
102 int city_id16, int city_id32,
105{
106 struct city *pcity;
107
108 if (!has_capability("ids32", pplayer->current_conn->capability)) {
109 city_id32 = city_id16;
110 }
111
112 pcity = player_city_by_number(pplayer, city_id32);
113
114 if (pcity == NULL) {
115 return;
116 }
117
118 if (to < 0 || to >= specialist_count()
119 || from < 0 || from >= specialist_count()
120 || !city_can_use_specialist(pcity, to)
121 || pcity->specialists[from] == 0) {
122 /* This could easily just be due to clicking faster on the specialist
123 * than the server can cope with. */
124 log_verbose("Error in specialist change request from client.");
125 return;
126 }
127
128 pcity->specialists[from]--;
129 pcity->specialists[to]++;
130
131 city_refresh(pcity);
132 sanity_check_city(pcity);
133 send_city_info(pplayer, pcity);
134}
135
136/**********************************************************************/
140 int city_id16, int city_id32, int tile_id)
141{
142 struct tile *ptile;
143 struct city *pcity;
144
145 if (!has_capability("ids32", pplayer->current_conn->capability)) {
146 city_id32 = city_id16;
147 }
148
149 ptile = index_to_tile(&(wld.map), tile_id);
150 pcity = player_city_by_number(pplayer, city_id32);
151
152 if (NULL == pcity) {
153 /* Probably lost. */
154 log_verbose("handle_city_make_specialist() bad city number %d.",
155 city_id32);
156 return;
157 }
158
159 if (NULL == ptile) {
160 log_error("handle_city_make_specialist() bad tile number %d.", tile_id);
161 return;
162 }
163
164 if (!city_map_includes_tile(pcity, ptile)) {
165 log_error("handle_city_make_specialist() tile (%d, %d) not in the "
166 "city map of \"%s\".", TILE_XY(ptile), city_name_get(pcity));
167 return;
168 }
169
170 if (is_free_worked(pcity, ptile)) {
172 } else if (tile_worked(ptile) == pcity) {
173 city_map_update_empty(pcity, ptile);
175 } else {
176 log_verbose("handle_city_make_specialist() not working (%d, %d) "
177 "\"%s\".", TILE_XY(ptile), city_name_get(pcity));
178 }
179
180 city_refresh(pcity);
181 sanity_check_city(pcity);
182 sync_cities();
183}
184
185/**********************************************************************/
190void handle_city_make_worker(struct player *pplayer,
191 int city_id16, int city_id32, int tile_id)
192{
193 struct tile *ptile = index_to_tile(&(wld.map), tile_id);
194 struct city *pcity;
195
196 if (!has_capability("ids32", pplayer->current_conn->capability)) {
197 city_id32 = city_id16;
198 }
199
200 pcity = player_city_by_number(pplayer, city_id32);
201
202 if (NULL == pcity) {
203 /* Probably lost. */
204 log_verbose("handle_city_make_worker() bad city number %d.", city_id32);
205 return;
206 }
207
208 if (NULL == ptile) {
209 log_error("handle_city_make_worker() bad tile number %d.", tile_id);
210 return;
211 }
212
213 if (!city_map_includes_tile(pcity, ptile)) {
214 log_error("handle_city_make_worker() tile (%d, %d) not in the "
215 "city map of \"%s\".", TILE_XY(ptile), city_name_get(pcity));
216 return;
217 }
218
219 if (is_free_worked(pcity, ptile)) {
221 sync_cities();
222 return;
223 }
224
225 if (tile_worked(ptile) == pcity) {
226 log_verbose("handle_city_make_worker() already working (%d, %d) \"%s\".",
227 TILE_XY(ptile), city_name_get(pcity));
228 return;
229 }
230
231 if (0 == city_specialists(pcity)) {
232 log_verbose("handle_city_make_worker() no specialists (%d, %d) \"%s\".",
233 TILE_XY(ptile), city_name_get(pcity));
234 return;
235 }
236
237 if (!city_can_work_tile(pcity, ptile)) {
238 log_verbose("handle_city_make_worker() cannot work here (%d, %d) \"%s\".",
239 TILE_XY(ptile), city_name_get(pcity));
240 return;
241 }
242
243 city_map_update_worker(pcity, ptile);
244
246 if (pcity->specialists[i] > 0) {
247 pcity->specialists[i]--;
248 break;
249 }
251
252 city_refresh(pcity);
253 sanity_check_city(pcity);
254 sync_cities();
255}
256
257/**********************************************************************/
261void really_handle_city_sell(struct player *pplayer, struct city *pcity,
262 struct impr_type *pimprove)
263{
264 enum test_result sell_result;
265 int price;
266
267 sell_result = test_player_sell_building_now(pplayer, pcity, pimprove);
268
269 if (sell_result == TR_ALREADY_SOLD) {
270 notify_player(pplayer, pcity->tile, E_BAD_COMMAND, ftc_server,
271 _("You have already sold something here this turn."));
272 return;
273 }
274
275 if (sell_result != TR_SUCCESS) {
276 return;
277 }
278
279 pcity->did_sell=TRUE;
280 price = impr_sell_gold(pimprove);
281 notify_player(pplayer, pcity->tile, E_IMP_SOLD, ftc_server,
282 PL_("You sell %s in %s for %d gold.",
283 "You sell %s in %s for %d gold.", price),
285 city_link(pcity), price);
286 do_sell_building(pplayer, pcity, pimprove, "sold");
287
288 city_refresh(pcity);
289
290 /* If we sold the walls the other players should see it */
291 send_city_info(NULL, pcity);
292 send_player_info_c(pplayer, pplayer->connections);
293}
294
295/**********************************************************************/
299void handle_city_sell(struct player *pplayer, int city_id16, int city_id32,
300 int build_id)
301{
302 struct city *pcity;
303 struct impr_type *pimprove = improvement_by_number(build_id);
304
305 if (!has_capability("ids32", pplayer->current_conn->capability)) {
306 city_id32 = city_id16;
307 }
308
309 pcity = player_city_by_number(pplayer, city_id32);
310
311 if (!pcity || !pimprove) {
312 return;
313 }
314
315 really_handle_city_sell(pplayer, pcity, pimprove);
316}
317
318/**********************************************************************/
322void really_handle_city_buy(struct player *pplayer, struct city *pcity)
323{
324 int cost, total;
325
326 /* This function corresponds to city_can_buy() in the client. */
327
328 fc_assert_ret(pcity && player_owns_city(pplayer, pcity));
329
330 if (pcity->turn_founded == game.info.turn) {
331 notify_player(pplayer, pcity->tile, E_BAD_COMMAND, ftc_server,
332 _("Cannot buy in city created this turn."));
333 return;
334 }
335
336 if (pcity->did_buy) {
337 notify_player(pplayer, pcity->tile, E_BAD_COMMAND, ftc_server,
338 _("You have already bought this turn."));
339 return;
340 }
341
342 if (city_production_has_flag(pcity, IF_GOLD)) {
343 notify_player(pplayer, pcity->tile, E_BAD_COMMAND, ftc_server,
344 _("You don't buy %s!"),
346 return;
347 }
348
349 if (VUT_UTYPE == pcity->production.kind && pcity->anarchy != 0) {
350 notify_player(pplayer, pcity->tile, E_BAD_COMMAND, ftc_server,
351 _("Can't buy units when city is in disorder."));
352 return;
353 }
354
357 if (cost <= 0) {
358 return; /* sanity */
359 }
360 if (cost > pplayer->economic.gold) {
361 /* In case something changed while player tried to buy, or player
362 * tried to cheat! */
363 /* Split into two to allow localization of two pluralisations. */
364 char buf[MAX_LEN_MSG];
365 /* TRANS: This whole string is only ever used when included in one
366 * other string (search for this string to find it). */
367 fc_snprintf(buf, ARRAY_SIZE(buf), PL_("%d gold required.",
368 "%d gold required.",
369 cost), cost);
370 notify_player(pplayer, pcity->tile, E_BAD_COMMAND, ftc_server,
371 /* TRANS: %s is a pre-pluralised string:
372 * "%d gold required." */
373 PL_("%s You only have %d gold.",
374 "%s You only have %d gold.", pplayer->economic.gold),
375 buf, pplayer->economic.gold);
376 return;
377 }
378
379 pplayer->economic.gold -= cost;
380 if (pcity->shield_stock < total) {
381 /* As we never put penalty on disbanded_shields, we can
382 * fully well add the missing shields there. */
383 pcity->disbanded_shields += total - pcity->shield_stock;
384 pcity->shield_stock=total; /* AI wants this -- Syela */
385 pcity->did_buy = TRUE; /* !PS: no need to set buy flag otherwise */
386 }
387 city_refresh(pcity);
388
389 if (VUT_UTYPE == pcity->production.kind) {
390 notify_player(pplayer, pcity->tile, E_UNIT_BUY, ftc_server,
391 /* TRANS: bought an unit. */
392 Q_("?unit:You bought %s in %s."),
394 city_name_get(pcity));
395 } else if (VUT_IMPROVEMENT == pcity->production.kind) {
396 notify_player(pplayer, pcity->tile, E_IMP_BUY, ftc_server,
397 /* TRANS: bought an improvement .*/
398 Q_("?improvement:You bought %s in %s."),
400 city_name_get(pcity));
401 }
402
404 send_city_info(pplayer, pcity);
405 send_player_info_c(pplayer, pplayer->connections);
407}
408
409/**********************************************************************/
412void handle_city_worklist(struct player *pplayer, int city_id16, int city_id32,
413 const struct worklist *worklist)
414{
415 struct city *pcity;
416
417 if (!has_capability("ids32", pplayer->current_conn->capability)) {
418 city_id32 = city_id16;
419 }
420
421 pcity = player_city_by_number(pplayer, city_id32);
422
423 if (pcity == NULL) {
424 return;
425 }
426
428
429 send_city_info(pplayer, pcity);
430}
431
432/**********************************************************************/
436void handle_city_buy(struct player *pplayer, int city_id16, int city_id32)
437{
438 struct city *pcity;
439
440 if (!has_capability("ids32", pplayer->current_conn->capability)) {
441 city_id32 = city_id16;
442 }
443
444 pcity = player_city_by_number(pplayer, city_id32);
445
446 if (pcity == NULL) {
447 return;
448 }
449
450 really_handle_city_buy(pplayer, pcity);
451}
452
453/**********************************************************************/
456void handle_city_refresh(struct player *pplayer, int city_id16, int city_id32)
457{
458 if (!has_capability("ids32", pplayer->current_conn->capability)) {
459 city_id32 = city_id16;
460 }
461
462 if (city_id32 != 0) {
463 struct city *pcity = player_city_by_number(pplayer, city_id32);
464
465 if (pcity == NULL) {
466 return;
467 }
468
469 city_refresh(pcity);
470 send_city_info(pplayer, pcity);
471 } else {
473 }
474}
475
476/**********************************************************************/
479void handle_city_change(struct player *pplayer, int city_id16, int city_id32,
480 int production_kind, int production_value)
481{
482 struct universal prod;
483 struct city *pcity;
484 const struct civ_map *nmap = &(wld.map);
485
486 if (!has_capability("ids32", pplayer->current_conn->capability)) {
487 city_id32 = city_id16;
488 }
489
490 pcity = player_city_by_number(pplayer, city_id32);
491
492 if (!universals_n_is_valid(production_kind)) {
493 log_error("[%s] bad production_kind %d.", __FUNCTION__,
494 production_kind);
495 prod.kind = VUT_NONE;
496 return;
497 } else {
498 prod = universal_by_number(production_kind, production_value);
499 if (!universals_n_is_valid(prod.kind)) {
500 log_error("[%s] production_kind %d with bad production_value %d.",
501 __FUNCTION__, production_kind, production_value);
502 prod.kind = VUT_NONE;
503 return;
504 }
505 }
506
507 if (pcity == NULL) {
508 return;
509 }
510
511 if (are_universals_equal(&pcity->production, &prod)) {
512 /* The client probably shouldn't send such a packet. */
513 return;
514 }
515
516 if (!can_city_build_now(nmap, pcity, &prod)) {
517 return;
518 }
519 if (!city_can_change_build(pcity)) {
520 notify_player(pplayer, pcity->tile, E_BAD_COMMAND, ftc_server,
521 _("You have bought this turn, can't change."));
522 return;
523 }
524
525 change_build_target(pplayer, pcity, &prod, E_CITY_PRODUCTION_CHANGED);
526
527 city_refresh(pcity);
528 sanity_check_city(pcity);
529 send_city_info(pplayer, pcity);
530}
531
532/**********************************************************************/
535void handle_city_rename(struct player *pplayer, int city_id16, int city_id32,
536 const char *name)
537{
538 struct city *pcity;
539 char message[1024];
540
541 if (!has_capability("ids32", pplayer->current_conn->capability)) {
542 city_id32 = city_id16;
543 }
544
545 pcity = player_city_by_number(pplayer, city_id32);
546
547 if (pcity == NULL) {
548 return;
549 }
550
551 if (!is_allowed_city_name(pplayer, name, message, sizeof(message))) {
552 notify_player(pplayer, pcity->tile, E_BAD_COMMAND,
553 ftc_server, "%s", message);
554 return;
555 }
556
557 city_name_set(pcity, name);
558 city_refresh(pcity);
559 send_city_info(NULL, pcity);
560}
561
562/**********************************************************************/
566void handle_city_options_req(struct player *pplayer,
567 int city_id16, int city_id32,
568 bv_city_options options)
569{
570 struct city *pcity;
571
572 if (!has_capability("ids32", pplayer->current_conn->capability)) {
573 city_id32 = city_id16;
574 }
575
576 pcity = player_city_by_number(pplayer, city_id32);
577
578 if (pcity == NULL) {
579 return;
580 }
581
582 pcity->city_options = options;
583
584 send_city_info(pplayer, pcity);
585}
586
587/**********************************************************************/
590void handle_city_rally_point(struct player *pplayer,
591 const struct packet_city_rally_point *packet)
592{
593 struct city *pcity;
594
595 if (!has_capability("ids32", pplayer->current_conn->capability)) {
596 pcity = player_city_by_number(pplayer, packet->city_id16);
597 } else {
598 pcity = player_city_by_number(pplayer, packet->city_id32);
599 }
600
601 if (pcity != NULL) {
602 city_rally_point_receive(packet, pcity);
603 send_city_info(pplayer, pcity);
604 }
605}
bool action_prob_possible(const struct act_prob probability)
Definition actions.c:6703
struct act_prob action_prob_vs_tile(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
Definition actions.c:6224
bool has_capability(const char *cap, const char *capstr)
Definition capability.c:77
bool is_free_worked(const struct city *pcity, const struct tile *ptile)
Definition city.c:3500
int city_production_build_shield_cost(const struct city *pcity)
Definition city.c:722
void city_name_set(struct city *pcity, const char *new_name)
Definition city.c:1123
const char * city_name_get(const struct city *pcity)
Definition city.c:1115
bool city_can_use_specialist(const struct city *pcity, Specialist_type_id type)
Definition city.c:1043
bool city_production_has_flag(const struct city *pcity, enum impr_flag_id flag)
Definition city.c:712
bool city_map_includes_tile(const struct city *const pcity, const struct tile *map_tile)
Definition city.c:288
citizens city_specialists(const struct city *pcity)
Definition city.c:3230
void city_rally_point_receive(const struct packet_city_rally_point *packet, struct city *pcity)
Definition city.c:3540
bool can_city_build_now(const struct civ_map *nmap, const struct city *pcity, const struct universal *target)
Definition city.c:991
bool city_can_work_tile(const struct city *pcity, const struct tile *ptile)
Definition city.c:1429
bool city_can_change_build(const struct city *pcity)
Definition city.c:1057
void handle_city_rally_point(struct player *pplayer, const struct packet_city_rally_point *packet)
Definition cityhand.c:590
void handle_city_refresh(struct player *pplayer, int city_id16, int city_id32)
Definition cityhand.c:456
void handle_city_options_req(struct player *pplayer, int city_id16, int city_id32, bv_city_options options)
Definition cityhand.c:566
void handle_city_make_specialist(struct player *pplayer, int city_id16, int city_id32, int tile_id)
Definition cityhand.c:139
void handle_city_make_worker(struct player *pplayer, int city_id16, int city_id32, int tile_id)
Definition cityhand.c:190
void really_handle_city_buy(struct player *pplayer, struct city *pcity)
Definition cityhand.c:322
void handle_city_worklist(struct player *pplayer, int city_id16, int city_id32, const struct worklist *worklist)
Definition cityhand.c:412
void handle_city_sell(struct player *pplayer, int city_id16, int city_id32, int build_id)
Definition cityhand.c:299
void handle_city_change(struct player *pplayer, int city_id16, int city_id32, int production_kind, int production_value)
Definition cityhand.c:479
void handle_city_buy(struct player *pplayer, int city_id16, int city_id32)
Definition cityhand.c:436
void handle_city_change_specialist(struct player *pplayer, int city_id16, int city_id32, Specialist_type_id from, Specialist_type_id to)
Definition cityhand.c:101
void handle_city_name_suggestion_req(struct player *pplayer, int unit_id16, int unit_id32)
Definition cityhand.c:60
void handle_city_rename(struct player *pplayer, int city_id16, int city_id32, const char *name)
Definition cityhand.c:535
void really_handle_city_sell(struct player *pplayer, struct city *pcity, struct impr_type *pimprove)
Definition cityhand.c:261
void city_map_update_empty(struct city *pcity, struct tile *ptile)
Definition citytools.c:3164
const char * city_name_suggestion(struct player *pplayer, struct tile *ptile)
Definition citytools.c:456
int city_production_buy_gold_cost(const struct city *pcity)
Definition citytools.c:3537
void send_city_info(struct player *dest, struct city *pcity)
Definition citytools.c:2327
void sync_cities(void)
Definition citytools.c:3238
void change_build_target(struct player *pplayer, struct city *pcity, struct universal *target, enum event_type event)
Definition citytools.c:3075
bool is_allowed_city_name(struct player *pplayer, const char *cityname, char *error_buf, size_t bufsz)
Definition citytools.c:372
void do_sell_building(struct player *pplayer, struct city *pcity, struct impr_type *pimprove, const char *reason)
Definition citytools.c:2910
void city_map_update_worker(struct city *pcity, struct tile *ptile)
Definition citytools.c:3178
void auto_arrange_workers(struct city *pcity)
Definition cityturn.c:369
bool city_refresh(struct city *pcity)
Definition cityturn.c:161
void city_refresh_for_player(struct player *pplayer)
Definition cityturn.c:185
void conn_list_do_unbuffer(struct conn_list *dest)
Definition connection.c:365
void conn_list_do_buffer(struct conn_list *dest)
Definition connection.c:355
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:73
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int cost
Definition dialogs_g.h:73
int Specialist_type_id
Definition fc_types.h:345
test_result
Definition fc_types.h:1097
@ TR_ALREADY_SOLD
Definition fc_types.h:1100
@ TR_SUCCESS
Definition fc_types.h:1098
#define Q_(String)
Definition fcintl.h:70
#define PL_(String1, String2, n)
Definition fcintl.h:71
#define _(String)
Definition fcintl.h:67
const struct ft_color ftc_server
const char * city_link(const struct city *pcity)
struct civ_game game
Definition game.c:57
struct world wld
Definition game.c:58
struct impr_type * improvement_by_number(const Impr_type_id id)
int impr_sell_gold(const struct impr_type *pimprove)
enum test_result test_player_sell_building_now(struct player *pplayer, struct city *pcity, const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
const char * name
Definition inputfile.c:127
#define fc_assert_ret(condition)
Definition log.h:191
#define log_verbose(message,...)
Definition log.h:109
#define log_error(message,...)
Definition log.h:103
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
Definition map.c:454
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
Definition notify.c:291
#define MAX_LEN_MSG
Definition packets.h:43
void dlsend_packet_city_name_suggestion_info(struct conn_list *dest, int unit_id16, int unit_id32, const char *name)
struct unit * player_unit_by_number(const struct player *pplayer, int unit_id)
Definition player.c:1205
struct city * player_city_by_number(const struct player *pplayer, int city_id)
Definition player.c:1179
bool player_owns_city(const struct player *pplayer, const struct city *pcity)
Definition player.c:255
void send_player_info_c(struct player *src, struct conn_list *dest)
Definition plrhand.c:1000
struct universal universal_by_number(const enum universals_n kind, const int value)
bool are_universals_equal(const struct universal *psource1, const struct universal *psource2)
#define sanity_check_city(x)
Definition sanitycheck.h:41
#define ARRAY_SIZE(x)
Definition shared.h:85
Specialist_type_id specialist_count(void)
Definition specialist.c:71
#define specialist_type_iterate_end
Definition specialist.h:79
#define specialist_type_iterate(sp)
Definition specialist.h:73
#define DEFAULT_SPECIALIST
Definition specialist.h:43
Definition city.h:309
bool did_sell
Definition city.h:367
int disbanded_shields
Definition city.h:377
bv_city_options city_options
Definition city.h:389
int turn_founded
Definition city.h:372
bool did_buy
Definition city.h:366
int anarchy
Definition city.h:370
struct worklist worklist
Definition city.h:387
struct universal production
Definition city.h:382
citizens specialists[SP_MAX]
Definition city.h:324
struct tile * tile
Definition city.h:311
int shield_stock
Definition city.h:355
struct packet_game_info info
Definition game.h:89
char capability[MAX_LEN_CAPSTR]
Definition connection.h:176
struct connection * current_conn
Definition player.h:297
struct conn_list * connections
Definition player.h:298
struct player_economic economic
Definition player.h:284
Definition tile.h:49
Definition unit.h:138
enum universals_n kind
Definition fc_types.h:758
universals_u value
Definition fc_types.h:757
struct civ_map map
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:969
#define TRUE
Definition support.h:46
#define tile_worked(_tile)
Definition tile.h:113
#define TILE_XY(ptile)
Definition tile.h:42
const struct unit_type * utype
Definition fc_types.h:604
const struct impr_type * building
Definition fc_types.h:598
#define unit_tile(_pu)
Definition unit.h:395
void illegal_action_msg(struct player *pplayer, const enum event_type event, struct unit *actor, const action_id stopped_action, const struct tile *target_tile, const struct city *target_city, const struct unit *target_unit)
Definition unithand.c:2352
const char * utype_name_translation(const struct unit_type *punittype)
Definition unittype.c:1612
void worklist_copy(struct worklist *dst, const struct worklist *src)
Definition worklist.c:112