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,15 +1119,19 @@ entership(unit * u, ship * sh, const char * cmd, boolean lasttry)
#ifdef CHECK_OVERLOAD_ON_ENTER
{
int sweight, scabins;
int mweight = shipcapacity(sh);
int mcabins = sh->type->cabins;
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);
return false;
}
}
}
#endif
leave(u->region, u);