Reihenfolge der Funktionen schafft Verwirrung über static functions.

This commit is contained in:
Enno Rehling 2004-06-15 08:19:03 +00:00
parent 6460e6ade0
commit 4ce2321579
1 changed files with 33 additions and 33 deletions

View File

@ -553,6 +553,39 @@ move_ship(ship * sh, region * from, region * to, region_list * route)
return sh; return sh;
} }
static boolean
check_working_buildingtype(const region * r, const building_type * bt)
{
building *b;
for (b = rbuildings(r); b; b = b->next) {
if (b->type == bt) {
if (b->size >= bt->maxsize && fval(b, BLD_WORKING)) {
return true;
}
}
}
return false;
}
static boolean
ship_allowed(const struct ship_type * type, const region * r)
{
int c = 0;
terrain_t t = rterrain(r);
static const building_type * bt_harbour=NULL;
if (bt_harbour==NULL) bt_harbour=bt_find("harbour");
if (check_working_buildingtype(r, bt_harbour)) return true;
for (c=0;type->coast[c]!=NOTERRAIN;++c) {
if (type->coast[c]==t) return true;
}
return false;
}
static void static void
drifting_ships(region * r) drifting_ships(region * r)
{ {
@ -1332,22 +1365,6 @@ buildingtype_exists(const region * r, const building_type * bt)
return false; return false;
} }
static boolean
check_working_buildingtype(const region * r, const building_type * bt)
{
building *b;
for (b = rbuildings(r); b; b = b->next) {
if (b->type == bt) {
if (b->size >= bt->maxsize && fval(b, BLD_WORKING)) {
return true;
}
}
}
return false;
}
/* Prüft, ob Ablegen von einer Küste in eine der erlaubten Richtungen erfolgt. */ /* Prüft, ob Ablegen von einer Küste in eine der erlaubten Richtungen erfolgt. */
static boolean static boolean
@ -1377,23 +1394,6 @@ flying_ship(const ship * sh)
return false; return false;
} }
static boolean
ship_allowed(const struct ship_type * type, const region * r)
{
int c = 0;
terrain_t t = rterrain(r);
static const building_type * bt_harbour=NULL;
if (bt_harbour==NULL) bt_harbour=bt_find("harbour");
if (check_working_buildingtype(r, bt_harbour)) return true;
for (c=0;type->coast[c]!=NOTERRAIN;++c) {
if (type->coast[c]==t) return true;
}
return false;
}
static region_list * static region_list *
sail(unit * u, region * next_point, boolean move_on_land) sail(unit * u, region * next_point, boolean move_on_land)
{ {