This is a nice mod, but the inactive elevators after restart and the overshooting are showstoppers.
I have here a patch for both problems:
Code: Select all
diff elevator-orig/init.lua elevator-patched/init.lua
32c32,37
< local f = io.open(elevator_file .. ".tmp", "w")
---
> -- FIX inactive elevators
> -- renaming (os.rename) is blocked by mod_security
> -- --> write direct to savefile
> --
> -- local f = io.open(elevator_file .. ".tmp", "w")
> local f = io.open(elevator_file , "w")
35c40
< os.rename(elevator_file .. ".tmp", elevator_file)
---
> -- os.rename(elevator_file .. ".tmp", elevator_file)
103a109,117
>
> -- FIX for "overshooting"
>
> local delta_y = math.abs(pos.y-target.y)
> local speed = SPEED
> if (delta_y<10) then
> speed = 2
> end
>
113c127,128
< obj:setvelocity({x=0, y=SPEED*obj:get_luaentity().vmult, z=0})
---
> -- obj:setvelocity({x=0, y=SPEED*obj:get_luaentity().vmult, z=0})
> obj:setvelocity({x=0, y=speed*obj:get_luaentity().vmult, z=0})
The inactive elevators were caused by the security as "os.<anything>" is not anymore freely available. The fast fix is to go without a backup save file.
The "overshooting" seems to be caused by a to high speed in relation to the distance. I have simply limited the speed for short distances.
I have now no more trouble with inactive elevators or landing outside of the elevator range.
PS: If you want to edit by hand: the lines with "<" have to be removed (mostly commented out) and the lines with ">" at that place included (added).