forked from github/server
Bugfix beschädigte Schiffe betreten
This commit is contained in:
parent
1e8988c74d
commit
e092cdf52b
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue