Add inventory space limit
This commit is contained in:
parent
a11dfb9352
commit
0c63cb075b
5 changed files with 44 additions and 9 deletions
|
@ -97,7 +97,7 @@ function getAttributes() {
|
|||
'Cargo capacity: ' + cargo;
|
||||
}
|
||||
|
||||
function validate() {
|
||||
export function validate() {
|
||||
let capsulesFound = 0;
|
||||
let thrustersFound = 0;
|
||||
let fuelFound = 0;
|
||||
|
@ -136,6 +136,8 @@ function validate() {
|
|||
reason = 'no thruster'
|
||||
} else if (fuelFound === 0) {
|
||||
reason = 'no fuel tank'
|
||||
} else if (inventory.usedSpace > inventory.capacity) {
|
||||
reason = 'inventory too full';
|
||||
} else {
|
||||
reason = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue