Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lua/entities/gmod_wire_thruster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
function ENT:Think()
BaseClass.Think(self)

self.ShouldDraw = GetConVarNumber("cl_drawthrusterseffects")

Check warning on line 53 in lua/entities/gmod_wire_thruster.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use ConVar objects instead

if self.ShouldDraw == 0 or not self:IsOn() then return end

Expand Down Expand Up @@ -139,8 +139,8 @@
-- Calculate the velocity
local ForceLinear, ForceAngular = phys:CalculateVelocityOffset(ThrusterWorldForce, phys:LocalToWorld( self.ThrustOffset ))

self.ForceLinear = phys:WorldToLocalVector(WireLib.clampForce(ForceLinear))
self.ForceAngular = phys:WorldToLocalVector(WireLib.clampForce(ForceAngular))
self.ForceLinear = WireLib.clampForce(ForceLinear)
self.ForceAngular = WireLib.clampForce(ForceAngular)
end

function ENT:SetDatEffect(uwater, owater, uweffect, oweffect)
Expand Down Expand Up @@ -180,10 +180,10 @@
self.owater = owater
self.uwater = uwater

if (not soundname) then soundname = "" end

Check warning on line 183 in lua/entities/gmod_wire_thruster.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of 'single quoted strings' and 'double quoted strings'

-- Preventing client crashes
local BlockedChars = '["?]'

Check warning on line 186 in lua/entities/gmod_wire_thruster.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of 'single quoted strings' and 'double quoted strings'
if ( string.find(soundname, BlockedChars) ) then
self:StopSound( self.SoundName )
soundname = ""
Expand All @@ -200,7 +200,7 @@

function ENT:TriggerInput(iname, value)
if (iname == "A") then
if ( (self.bidir) and (math.abs(value) > 0.01) and (math.abs(value) > self.force_min) ) or ( (value > 0.01) and (value > self.force_min) ) then

Check warning on line 203 in lua/entities/gmod_wire_thruster.lua

View workflow job for this annotation

GitHub Actions / lint

"Unnecessary parentheses"

Unnecessary parentheses
self:Switch(true, math.min(value, self.force_max))
else
self:Switch(false, 0)
Expand Down Expand Up @@ -241,7 +241,7 @@

self:CalcForce(phys)

return self.ForceAngular, self.ForceLinear, SIM_LOCAL_ACCELERATION
return self.ForceAngular, self.ForceLinear, SIM_GLOBAL_ACCELERATION
end

function ENT:Switch( on, mul )
Expand All @@ -252,7 +252,7 @@


if (on) then
if (changed) and (self.soundname and self.soundname ~= "") then

Check warning on line 255 in lua/entities/gmod_wire_thruster.lua

View workflow job for this annotation

GitHub Actions / lint

"Unnecessary parentheses"

Unnecessary parentheses
self:StopSound( self.soundname )
self:EmitSound( self.soundname )
end
Expand Down
Loading