From 9583fadc26afdde94a160acc6b3fc92c195ef05b Mon Sep 17 00:00:00 2001 From: cheapie Date: Fri, 26 Apr 2024 19:34:06 -0500 Subject: Hopefully fix car door drifting past closed sometimes --- doors.lua | 4 ++-- 1 file 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 -- cgit v1.2.3