1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Remove instant eject flag

This commit is contained in:
tobspr
2020-08-10 20:32:45 +02:00
parent b3b8da04a1
commit 89294c7072
5 changed files with 9 additions and 19 deletions

View File

@@ -26,10 +26,8 @@ export class ItemEjectorComponent extends Component {
}
static getSchema() {
// The cachedDestSlot, cachedTargetEntity fields
// are not serialized.
// The cachedDestSlot, cachedTargetEntity fields are not serialized.
return {
instantEject: types.bool,
slots: types.array(
types.structured({
pos: types.vector,
@@ -57,7 +55,6 @@ export class ItemEjectorComponent extends Component {
return new ItemEjectorComponent({
slots: slotsCopy,
instantEject: this.instantEject,
});
}
@@ -65,14 +62,10 @@ export class ItemEjectorComponent extends Component {
*
* @param {object} param0
* @param {Array<{pos: Vector, direction: enumDirection, layer?: enumLayer}>=} param0.slots The slots to eject on
* @param {boolean=} param0.instantEject If the ejection is instant
*/
constructor({ slots = [], instantEject = false }) {
constructor({ slots = [] }) {
super();
// How long items take to eject
this.instantEject = instantEject;
this.setSlots(slots);
/**
@@ -161,7 +154,7 @@ export class ItemEjectorComponent extends Component {
return false;
}
this.slots[slotIndex].item = item;
this.slots[slotIndex].progress = this.instantEject ? 1 : 0;
this.slots[slotIndex].progress = 0;
return true;
}