1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00

FIX pass (math.min instead %)

This commit is contained in:
Hellss
2022-07-13 17:43:49 +03:00
parent f28a9760f3
commit b5cd8a7745

View File

@@ -553,7 +553,7 @@ function ENT:Think()
if target <= 0 then
self.WindowEnd = self.WindowStart
else
elseif self.WindowEnd < self:PoolSize() then
local growthDelta = math.max(0,(target-self:PopulationCount())*0.005)
if growthDelta < 1.0 then -- Accumulate fractional rate
self.GrowthAccumulation = (self.GrowthAccumulation or 0) + growthDelta
@@ -562,7 +562,7 @@ function ENT:Think()
self.GrowthAccumulation = self.GrowthAccumulation - 1.0
end
end
self.WindowEnd = (self.WindowEnd + math.floor(growthDelta+0.5)) % self:PoolSize()
self.WindowEnd = math.min(self:PoolSize(), self.WindowEnd + math.floor(growthDelta+0.5))
end
end