Fix crash regarding blueprints being copied wrong
This commit is contained in:
parent
f33473b77a
commit
2a4ee8e784
|
@ -83,7 +83,7 @@ export const globalConfig = {
|
||||||
|
|
||||||
debug: {
|
debug: {
|
||||||
/* dev:start */
|
/* dev:start */
|
||||||
// fastGameEnter: true,
|
fastGameEnter: true,
|
||||||
// noArtificialDelays: true,
|
// noArtificialDelays: true,
|
||||||
// disableSavegameWrite: true,
|
// disableSavegameWrite: true,
|
||||||
// showEntityBounds: true,
|
// showEntityBounds: true,
|
||||||
|
@ -100,7 +100,7 @@ export const globalConfig = {
|
||||||
// testClipping: true,
|
// testClipping: true,
|
||||||
// framePausesBetweenTicks: 40,
|
// framePausesBetweenTicks: 40,
|
||||||
// testTranslations: true,
|
// testTranslations: true,
|
||||||
// enableEntityInspector: true,
|
enableEntityInspector: true,
|
||||||
// testAds: true,
|
// testAds: true,
|
||||||
// disableMapOverview: true,
|
// disableMapOverview: true,
|
||||||
disableTutorialHints: true,
|
disableTutorialHints: true,
|
||||||
|
|
|
@ -49,17 +49,35 @@ function stringPolyfills() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectPolyfills() {
|
function objectPolyfills() {
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries
|
// https://github.com/tc39/proposal-object-values-entries/blob/master/polyfill.js
|
||||||
// @ts-ignore
|
|
||||||
if (!Object.entries) {
|
|
||||||
// @ts-ignore
|
|
||||||
Object.entries = function (obj) {
|
|
||||||
var ownProps = Object.keys(obj),
|
|
||||||
i = ownProps.length,
|
|
||||||
resArray = new Array(i); // preallocate the Array
|
|
||||||
while (i--) resArray[i] = [ownProps[i], obj[ownProps[i]]];
|
|
||||||
|
|
||||||
return resArray;
|
// @ts-ignore
|
||||||
|
const reduce = Function.bind.call(Function.call, Array.prototype.reduce);
|
||||||
|
// @ts-ignore
|
||||||
|
const isEnumerable = Function.bind.call(Function.call, Object.prototype.propertyIsEnumerable);
|
||||||
|
// @ts-ignore
|
||||||
|
const concat = Function.bind.call(Function.call, Array.prototype.concat);
|
||||||
|
const keys = Reflect.ownKeys;
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
if (!Object.values) {
|
||||||
|
// @ts-ignore
|
||||||
|
Object.values = function values(O) {
|
||||||
|
return reduce(
|
||||||
|
keys(O),
|
||||||
|
(v, k) => concat(v, typeof k === "string" && isEnumerable(O, k) ? [O[k]] : []),
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Object.entries) {
|
||||||
|
Object.entries = function entries(O) {
|
||||||
|
return reduce(
|
||||||
|
keys(O),
|
||||||
|
(e, k) => concat(e, typeof k === "string" && isEnumerable(O, k) ? [[k, O[k]]] : []),
|
||||||
|
[]
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@ export class ItemAcceptorComponent extends Component {
|
||||||
slotsCopy.push({
|
slotsCopy.push({
|
||||||
pos: slot.pos.copy(),
|
pos: slot.pos.copy(),
|
||||||
directions: slot.directions.slice(),
|
directions: slot.directions.slice(),
|
||||||
|
filter: slot.filter,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,9 @@ export class HUDEntityDebugger extends BaseHUDPart {
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
const mousePos = this.root.app.mousePosition;
|
const mousePos = this.root.app.mousePosition;
|
||||||
|
if (!mousePos) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const worldPos = this.root.camera.screenToWorld(mousePos);
|
const worldPos = this.root.camera.screenToWorld(mousePos);
|
||||||
const worldTile = worldPos.toTileSpace();
|
const worldTile = worldPos.toTileSpace();
|
||||||
|
|
||||||
|
|
Reference in New Issue