forked from github/server
eliminate some high-level warnings
This commit is contained in:
parent
da83e3f2f6
commit
e97f80ad3c
1 changed files with 6 additions and 4 deletions
10
src/move.c
10
src/move.c
|
@ -508,7 +508,7 @@ static double overload(const region * r, ship * sh)
|
||||||
double ovl;
|
double ovl;
|
||||||
|
|
||||||
getshipweight(sh, &n, &p);
|
getshipweight(sh, &n, &p);
|
||||||
ovl = n / (double)(sh->type->cargo * sh->number);
|
ovl = n / (double)sh->type->cargo * sh->number;
|
||||||
if (mcabins) {
|
if (mcabins) {
|
||||||
ovl = fmax(ovl, p / (double)mcabins);
|
ovl = fmax(ovl, p / (double)mcabins);
|
||||||
}
|
}
|
||||||
|
@ -939,7 +939,7 @@ static unit *bewegung_blockiert_von(unit * reisender, region * r)
|
||||||
if ((u->faction == reisender->faction) || (ucontact(u, reisender)) || (alliedunit(u, reisender->faction, HELP_GUARD)))
|
if ((u->faction == reisender->faction) || (ucontact(u, reisender)) || (alliedunit(u, reisender->faction, HELP_GUARD)))
|
||||||
guard_count = guard_count - u->number;
|
guard_count = guard_count - u->number;
|
||||||
else if (sk >= stealth) {
|
else if (sk >= stealth) {
|
||||||
double prob_u = (sk - stealth) * skill_prob;
|
double prob_u = skill_prob * ((double)sk - stealth);
|
||||||
guard_count += u->number;
|
guard_count += u->number;
|
||||||
/* amulet counts at most once */
|
/* amulet counts at most once */
|
||||||
prob_u += fmin(1, fmin(u->number, i_get(u->items, ramulet->itype))) * amulet_prob;
|
prob_u += fmin(1, fmin(u->number, i_get(u->items, ramulet->itype))) * amulet_prob;
|
||||||
|
@ -1452,7 +1452,7 @@ static void var_create_regions(arg_regions *dst, const region_list * begin, int
|
||||||
{
|
{
|
||||||
const region_list *rsrc;
|
const region_list *rsrc;
|
||||||
int i;
|
int i;
|
||||||
|
assert(size > 0);
|
||||||
dst->nregions = size;
|
dst->nregions = size;
|
||||||
dst->regions = (region **) malloc(sizeof(region *) * (size_t)size);
|
dst->regions = (region **) malloc(sizeof(region *) * (size_t)size);
|
||||||
assert_alloc(dst->regions);
|
assert_alloc(dst->regions);
|
||||||
|
@ -1642,7 +1642,9 @@ static const region_list *travel_route(unit * u,
|
||||||
|
|
||||||
static bool ship_ready(const region * r, unit * u, order * ord)
|
static bool ship_ready(const region * r, unit * u, order * ord)
|
||||||
{
|
{
|
||||||
unit *cap = u->ship ? ship_owner(u->ship) : NULL;
|
unit* cap;
|
||||||
|
assert(u && u->ship);
|
||||||
|
cap = u->ship ? ship_owner(u->ship) : NULL;
|
||||||
if (u != cap) {
|
if (u != cap) {
|
||||||
cmistake(u, ord, 146, MSG_MOVE);
|
cmistake(u, ord, 146, MSG_MOVE);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue