Freeciv-3.2: /fast/freeciv/nightly/S3_2/server/advisors/advspace.c Source File

Freeciv-3.2

Loading...
Searching...
No Matches
advspace.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/* common */
19#include "government.h"
20#include "packets.h"
21#include "spaceship.h"
22
23/* server */
24#include "spacerace.h"
25
26#include "advspace.h"
27
28/************************************************************************/
33 bool adv_spaceship_autoplace(struct player *pplayer,
34 struct player_spaceship *ship)
35{
36 struct spaceship_component place;
37 bool retval = FALSE;
38 bool placed;
39
40 do {
41 placed = next_spaceship_component(pplayer, ship, &place);
42
43 if (placed) {
44 if (do_spaceship_place(pplayer, ACT_REQ_SS_AGENT,
45 place.type, place.num)) {
46 /* A part was placed. It was placed even if the placement of future
47 * parts will fail. */
48 retval = TRUE;
49 } else {
50 /* Unable to place this part. Don't try to place it again. */
51 break;
52 }
53 }
54 } while (placed);
55
56 return retval;
57}
adv_spaceship_autoplace
bool adv_spaceship_autoplace(struct player *pplayer, struct player_spaceship *ship)
Definition advspace.c:33
advspace.h
incite_cost
char * incite_cost
Definition comments.c:74
government.h
packets.h
do_spaceship_place
bool do_spaceship_place(struct player *pplayer, enum action_requester from, enum spaceship_place_type type, int num)
Definition spacerace.c:215
spacerace.h
next_spaceship_component
bool next_spaceship_component(struct player *pplayer, struct player_spaceship *ship, struct spaceship_component *fill)
Definition spaceship.c:130
spaceship.h
player_spaceship
Definition spaceship.h:94
player
Definition player.h:247
spaceship_component
Definition spaceship.h:132
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47