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

Fix energy generator being not rotateable

This commit is contained in:
tobspr
2020-07-06 19:31:00 +02:00
parent 0bba6a9d79
commit 54be64c0e2
17 changed files with 781 additions and 717 deletions

View File

@@ -1,5 +1,5 @@
import { types } from "../../savegame/serialization";
import { BaseItem } from "../base_item";
import { BaseItem, enumItemType } from "../base_item";
import { Component } from "../component";
import { ShapeItem } from "../items/shape_item";
@@ -59,6 +59,22 @@ export class EnergyGeneratorComponent extends Component {
// just destroy it
return true;
} else {
if (item.getItemType() !== enumItemType.shape) {
// This shouldn't happen since we have a filter - still, it doesn't hurt
// to check either
assertAlways(
false,
"Energy generator took wrong item: " +
item.getItemType() +
" on slot " +
slot +
" (waste slot = " +
this.wasteAcceptorSlotIndex +
")"
);
return false;
}
if (/** @type {ShapeItem} */ (item).definition.getHash() !== this.requiredKey) {
// Not our shape
return false;