The globalsteps runs only once per second (!); this is way too poor granularity. It could be a lot smoother if it ran as often as possible since it is a rather cheap globalstep.
Insufficient approach: This subtracts one from the player pos on the vertical axis. Player pos is a feet pos however. Thus this will fail horribly when standing on slabs and is always on the verge of failing (due to precision errors) when standing on full / almost full nodes. A more accurate approach would only subtract a small epsilon from the feet pos and take node boxes into account (e.g. when standing on smaller nodes (slabs) or larger nodes (doors)).
Misc. other (minor-ish) code quality issues:
Use of deprecated methods: player:getpos() (should trigger a warning?) and {x=...,y=...,z=...} vector (rather than vector.offset).
Unnecessary loc ~= nil check.
Poor formatting: Inconsistent use of indentation & semicolons.
Custom fields should use underscore prefixes. This mod does not abide by that convention for on_walk_over.
In conclusion, I would strongly advise against depending on this library in its current state. Modders should rather roll their own.
player:getpos()
(should trigger a warning?) and{x=...,y=...,z=...}
vector (rather thanvector.offset
).loc ~= nil
check.on_walk_over
.In conclusion, I would strongly advise against depending on this library in its current state. Modders should rather roll their own.