15 lines
580 B
JavaScript
15 lines
580 B
JavaScript
|
|
"use strict";
|
||
|
|
|
||
|
|
// Layer: entity-runtime/tarinai/update-step
|
||
|
|
// Owns end-of-frame wake lock and life/death checks.
|
||
|
|
(function (global) {
|
||
|
|
function update(t, dt, context = {}) {
|
||
|
|
if (!t) return { done: true };
|
||
|
|
const sleepingAtFrameEnd = t.state === "sleep" || t.sleeping;
|
||
|
|
if (context.wasSleepingAtFrameStart && !sleepingAtFrameEnd && !t.dead) t.awakeLockTimer = Math.max(t.awakeLockTimer || 0, 10);
|
||
|
|
t.checkLife(dt);
|
||
|
|
return { done: true };
|
||
|
|
}
|
||
|
|
|
||
|
|
global.TarinaiHealthUpdateStep = Object.freeze({ update });
|
||
|
|
})(typeof window !== "undefined" ? window : globalThis);
|