if (this.terminal && !this.isClearingTerminal()) {
        // Only count terminal resources if we count it's free capacity.
        limit -= Math.min(this.terminal.store.getCapacity(), this.terminal.store.getUsedCapacity());
    }