This commit is contained in:
Никита Круглицкий 2025-05-14 19:05:12 +06:00
parent 138d91b9f9
commit 9b50dbe33d
3 changed files with 9 additions and 9 deletions

View File

@ -119,14 +119,14 @@ function Engine:forwardStep(torque, inertia)
self.angularVelocity = self.angularVelocity + finalTorque / inertiaSum * TICK_INTERVAL self.angularVelocity = self.angularVelocity + finalTorque / inertiaSum * TICK_INTERVAL
self.angularVelocity = math.max(self.angularVelocity, 0) self.angularVelocity = math.max(self.angularVelocity, 0)
net.start("ENGINE_RPM") -- net.start("ENGINE_RPM")
net.writeFloat(self:getRPM() / self.maxRPM) -- net.writeFloat(self:getRPM() / self.maxRPM)
net.send(self.vehicle.playersConnectedToHUD, true) -- net.send(self.vehicle.playersConnectedToHUD, true)
net.start("ENGINE_FULLRPM") -- net.start("ENGINE_FULLRPM")
net.writeUInt(self:getRPM(), 16) -- net.writeUInt(self:getRPM(), 16)
net.writeFloat(self.masterThrottle) -- net.writeFloat(self.masterThrottle)
net.send(nil, true) -- net.send(nil, true)
end end
return Engine return Engine

View File

@ -91,7 +91,7 @@ function PowertrainComponent:updateWireOutputs()
WireComponent.updateWireOutputs(self) WireComponent.updateWireOutputs(self)
if self.DEBUG then if self.DEBUG then
-- self:DEBUG_SEND_DATA_DEBOUNCED() self:DEBUG_SEND_DATA_DEBOUNCED()
end end
end end

View File

@ -29,7 +29,7 @@ function Sound:initialize(redline, parent, sounds)
[8500] = "https://raw.githubusercontent.com/koptilnya/gmod-data/main/engine_sounds/bmw_s54/ext_e30s54_on_8500.ogg" [8500] = "https://raw.githubusercontent.com/koptilnya/gmod-data/main/engine_sounds/bmw_s54/ext_e30s54_on_8500.ogg"
} }
local redline = redline or 7000 local redline = redline or 7000
self.active = true self.active = false
local soundObjects = {} local soundObjects = {}
local soundRpms = {} local soundRpms = {}
local maxValue = 0 local maxValue = 0