15 lines
653 B
JavaScript
15 lines
653 B
JavaScript
"use strict";
|
|
|
|
// Layer: entity-runtime/items/lifecycle-step
|
|
// Fallback step for environments where the split item lifecycle pipeline cannot
|
|
// run. The captured legacy Item.prototype.update is kept by item_runtime.js.
|
|
(function (global) {
|
|
function update(item, dt, worldRef, context = {}) {
|
|
const legacyUpdate = context.legacyUpdate;
|
|
if (!item || item.dead || typeof legacyUpdate !== "function") return { done: true, ok: false };
|
|
legacyUpdate.call(item, dt, worldRef);
|
|
return { done: true, ok: true };
|
|
}
|
|
|
|
global.TarinaiItemLegacyLifecycleStep = Object.freeze({ update });
|
|
})(typeof window !== "undefined" ? window : globalThis);
|