Skip to content

Commit

Permalink
Don't lose heat as fast if the gun is revved to prevent feathering
Browse files Browse the repository at this point in the history
  • Loading branch information
shroobloom committed Feb 19, 2025
1 parent 42f5135 commit 8834ea1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/entities/turret_bullets/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ DEFINE_BASECLASS( "emplacements_turret_base" )

-- The rate heat generates per second at peak firerate
local OVERHEAT_TIME = 14
local COOLING_TIME = 7
local COOLING_TIME = 4

-- How long it takes to spin up
local SPINUP_TIME = 3
Expand Down Expand Up @@ -52,10 +52,10 @@ end

function ENT:RunHeatHandler()
if self.Firing then
self:SetHeat( math.min( self:GetHeat() + FrameTime() / OVERHEAT_TIME, 1 ) )
self:SetHeat( math.min( self:GetHeat() + FrameTime() / OVERHEAT_TIME * self.SpinUp, 1 ) )
self.SpinUp = math.min( self.SpinUp + FrameTime() / SPINUP_TIME, 1 )
else
self:SetHeat( math.max( self:GetHeat() - FrameTime() / COOLING_TIME, 0 ) )
self:SetHeat( math.max( self:GetHeat() - FrameTime() / COOLING_TIME * (1-self.SpinUp), 0 ) )
self.SpinUp = math.max( self.SpinUp - FrameTime() / SPINDOWN_TIME, 0 )
end

Expand Down

0 comments on commit 8834ea1

Please sign in to comment.