1.8 KiB
1.8 KiB
klon_siluet.js — startLoop() (satır 549)
if (fresh) { morph = fresh; ghostKey = -1; }
}
// --- canli ayarlar ---
var ghostMax = getOpt(st, findOpt("ghost"));
var lifeMax = getOpt(st, findOpt("life"));
var alphaPct = getOpt(st, findOpt("alpha"));
var minSpeed = getOpt(st, findOpt("min"));
var range = getOpt(st, findOpt("range"));
var faceMove = st.getNumber("sil_face") === 1;
var debug = st.getNumber("sil_debug") === 1;
var mode = modeIdx(st);
var part = PARTS[clampIdx(st.getNumber(ST_PART), PARTS.length)].p;
var alpha = alphaPct / 100;
// saydamlik degistiyse siluet morph'unu yeniden uret
if (morph && ghostKey !== alphaPct)
{
ghost = applyAlpha(morph, alpha);
ghostKey = alphaPct;
}
// --- hiz: pozisyon farki (getMotion sprint/ucusta guvenilmez) ---
var cp = pl.getPosition();
var dx = cp.x - prevX;
var dy = cp.y - prevY;
var dz = cp.z - prevZ;
var speed = Math.sqrt(dx * dx + dz * dz); // yatay hiz
var teleport = speed >= TP_GUARD;
// --- tavan hiz kalibrasyonu (Essentials /speed farkini otomatik yakalar) ---
if (!teleport)
{
if (speed > peak) peak = speed;
else peak = peak * PEAK_DECAY + speed * (1 - PEAK_DECAY);
}
var hi = Math.max(peak, MOVE_EPS + 0.08);
// --- tetik ---
var moving = speed >= MOVE_EPS;
var fast = speed >= minSpeed;
var sprintB = sprinting(pl);