`local globalstate` is initialised to have the field `suppressed_players`, but the non-existent field `suppress` is requested, resulting in operations on nil rather than the expected table. This causes the aforementioned crash.
This commit fixes this issue.
When you do weac.notify(player_name, "info", "msg"), Lua auto-inserts a `self` table which refers to the main `Notify` table there.
This is because `local function call()` is registered via `setmetatable(Notify, ...)`, which auto-inserts `self` as the 1st argument.
To this end, this command adds a dummy 1st argument `_self` to capture this extra table to avoid all args being shifted by 1.
....it works, but:
- We can't capture stack traces like this
- It's messy
- We need to implement an escape/encodeURIComponent function ourselves from scratch 'cause the one I ripped from Stack Overflow sucks
Ref https://discord.com/channels/1135598362821935254/1247681375935533119
---------------------------------------
Hi, a wild //orient+ appeared! While it (probably) doesn't crash, it also unfortunately doesn't work yet.
This is because facedir e.g. points towards the direction the node is pointing, and minetest.facedir_to_dir doesn't capture all the nuance of how the node is pointing, and e.g. if a node is pointing +y and you want to rotate by (0, 90, 0) [degrees], then the current implementation won't do anything.
Then I decided that this is silly and there has to be a solution. After all, screwdriver2 has a great implementation! https://content.minetest.net/packages/12Me21/screwdriver2/
....then I found this lookup table in their codebase: https://github.com/12Me21/screwdriver2/blob/master/init.lua#L75-L79
....aaaaarrrggggghhhhh //orient+ is such a pain to implement!
and my existing implementation is so neat 😢1dd073f14b/worldeditadditions_core/utils/param2.lua
so, in other words, although I've implemented //orient+ I'm going to have to reimplement the nuts-and-bolts function that does the rotation, which may make it slightly more complicated and annoying to implement support for nodes with param2 types other than facedir.
/rant about Minetest's param2 value and rotations 😛
...but it doesn't work yet
currently it crashes with a variety of interesting and colourful error messages
working on debugging it now, but it's gonna take a moment