Installer Steam
log på
|
sprog
简体中文 (forenklet kinesisk)
繁體中文 (traditionelt kinesisk)
日本語 (japansk)
한국어 (koreansk)
ไทย (thai)
Български (bulgarsk)
Čeština (tjekkisk)
Deutsch (tysk)
English (engelsk)
Español – España (spansk – Spanien)
Español – Latinoamérica (spansk – Latinamerika)
Ελληνικά (græsk)
Français (fransk)
Italiano (italiensk)
Bahasa indonesia (indonesisk)
Magyar (ungarsk)
Nederlands (hollandsk)
Norsk
Polski (polsk)
Português (portugisisk – Portugal)
Português – Brasil (portugisisk – Brasilien)
Română (rumænsk)
Русский (russisk)
Suomi (finsk)
Svenska (svensk)
Türkçe (tyrkisk)
Tiếng Việt (Vietnamesisk)
Українська (ukrainsk)
Rapporter et oversættelsesproblem
-- Checks and fixes zombies stuck in turnalerted animation (runs every ~1 second)
local function CheckZombieAnimationState()
if not (isClient() or isServer()) then return end -- Skip in single-player
local cell = getCell()
local zombies = cell:getZombieList()
if not zombies then return end -- Early exit if no zombies
local size = zombies:size() -- Cache size to avoid repeated calls
for i = 0, size - 1 do
local zombie = zombies:get(i)
if zombie and not zombie:getVariableBoolean("Bandit") then
local modData = zombie:getModData() -- Cache mod data
local currentState = zombie:getActionStateName()
local stuckTime = modData.stuckTime or 0
if currentState == "turnalerted" then
stuckTime = stuckTime + 1
modData.stuckTime = stuckTime
-- Reset zombie if stuck in turnalerted for ~5 seconds (300 ticks at 60 FPS)
if stuckTime > 300 then
modData.stuckTime = 0
zombie:setActionStateName("idle")
zombie:setTurnDelta(0)
zombie:setTurnAlertedValues(0, 0)
zombie:resetModelNextFrame()
end
else
modData.stuckTime = 0
end
end
end
end
-- Run CheckZombieAnimationState every 60 ticks (~1 second at 60 FPS)
local tickCounter = 0
Events.OnTick.Add(function()
tickCounter = tickCounter + 1
if tickCounter >= 60 then
CheckZombieAnimationState()
tickCounter = 0 -- Reset counter
end
end)
optimized?