summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-04-26 19:34:06 -0500
committercheapie <no-email-for-you@example.com>2024-04-26 19:34:06 -0500
commit9583fadc26afdde94a160acc6b3fc92c195ef05b (patch)
tree9aea17367edd33f80b0a03ccad26cd50eaf5bd1b
parentb8551c435a40a3f1be957e6e0c326938553053b2 (diff)
downloadcelevator-9583fadc26afdde94a160acc6b3fc92c195ef05b.tar
celevator-9583fadc26afdde94a160acc6b3fc92c195ef05b.tar.gz
celevator-9583fadc26afdde94a160acc6b3fc92c195ef05b.tar.bz2
celevator-9583fadc26afdde94a160acc6b3fc92c195ef05b.tar.xz
celevator-9583fadc26afdde94a160acc6b3fc92c195ef05b.zip
Hopefully fix car door drifting past closed sometimes
-rw-r--r--doors.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/doors.lua b/doors.lua
index a282937..163ba58 100644
--- a/doors.lua
+++ b/doors.lua
@@ -444,8 +444,8 @@ function celevator.doors.carstep(dtime)
celevator.doors.erefs[hash][i]:set_velocity(vector.multiply(data.opendir,vel/2*-0.66))
end
if data.time >= math.pi then
- for i=1,6,1 do
- celevator.doors.erefs[hash][i]:set_velocity(vector.new(0,0,0))
+ for _,ref in ipairs(celevator.doors.erefs[hash]) do
+ ref:set_velocity(vector.new(0,0,0))
end
celevator.get_meta(data.positions[1]):set_string("doorstate","closed")
cardoors_moving[hash] = nil