diff --git a/src/Core/Scripting/OOJSShip.m b/src/Core/Scripting/OOJSShip.m index ac40d9ad..0eb1e6c4 100644 --- a/src/Core/Scripting/OOJSShip.m +++ b/src/Core/Scripting/OOJSShip.m @@ -1386,7 +1386,7 @@ static JSBool ShipSetProperty(JSContext *context, JSObject *this, jsid propID, J { iValue = 0; } - if ((OOCargoQuantity)iValue < [entity maxAvailableCargoSpace] - [entity availableCargoSpace]) + else if ((OOCargoQuantity)iValue < [entity maxAvailableCargoSpace] - [entity availableCargoSpace]) { iValue = [entity maxAvailableCargoSpace] - [entity availableCargoSpace]; }