-
Notifications
You must be signed in to change notification settings - Fork 1
Minor fixes and code cleanup #4
base: master
Are you sure you want to change the base?
Conversation
local tag = "prop_vehicle_crawler" | ||
|
||
--FastDL | ||
local function add_resource_dir(dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think there is a problem here, maybe invisible char?
if IsValid(self.Trails[i]) then SafeRemoveEntity(self.Trails[i]) end | ||
|
||
self.Trails[i] = util.SpriteTrail(self, i, self.EnergyColor, true, 32, 0, 0.1, 0.015625, "trails/laser.vmt") | ||
if CPPI then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does CPPI come from ?
Also SetOwner is in vanilla gmod so you want to call that regardless of CPPI
@@ -0,0 +1,209 @@ | |||
include("shared.lua") | |||
local tag = "prop_vehicle_crawler" | |||
local Ride_Height = 33 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for constants should be CAPITAL_SNAKE_CASE
self.Wheel:SetAngles(self:LocalToWorldAngles(Angle(self.vel_increment, 0, 0))) | ||
|
||
--Wheel suspension | ||
local Terrain_Distance = util.TraceHull({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you using snake_case or PascalCase here? Please use snake_case consistently
mask = MASK_SOLID, | ||
collisiongroup = COLLISION_GROUP_WEAPON | ||
}) | ||
self.Wheel:SetPos(self:LocalToWorld(WHEEL_OFFSET + Vector(0, 0, Ride_Height_Visual- Terrain_Distance.Fraction * Ride_Height_Visual))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some spaces missing between operators, put the files through a formatter / linter of some kind
I split the code into 3 seperate files so it wouldn't be so disgusting to look at, also changed the janky network pingpong shit to use NetworkVar() and (hopefully) made the wheel spin speed not depend on the framerate.