Bugfix beschädigte Schiffe betreten

This commit is contained in:
Enno Rehling 2003-01-03 12:39:03 +00:00
parent 1e8988c74d
commit e092cdf52b
1 changed files with 10 additions and 6 deletions

View File

@ -1119,13 +1119,17 @@ entership(unit * u, ship * sh, const char * cmd, boolean lasttry)
#ifdef CHECK_OVERLOAD_ON_ENTER #ifdef CHECK_OVERLOAD_ON_ENTER
{ {
int sweight, scabins; int sweight, scabins;
getshipweight(sh, &sweight, &scabins); int mweight = shipcapacity(sh);
sweight += weight(u); int mcabins = sh->type->cabins;
scabins += u->number; if (mweight>0 && mcabins>0) {
getshipweight(sh, &sweight, &scabins);
sweight += weight(u);
scabins += u->number;
if (sweight > shipcapacity(sh) || scabins > sh->type->cabins) { if (sweight > mweight || scabins > mcabins) {
if (lasttry) cmistake(u, cmd, 34, MSG_MOVE); if (lasttry) cmistake(u, cmd, 34, MSG_MOVE);
return false; return false;
}
} }
} }
#endif #endif