This pass cleans up a lot of unnecessary table allocation and disposal, which should help with memory usage and garbage collection.
It also adds some sophistication to the entity damage process from diggers, allowing items to be picked up into Digtron inventory.
* Use updated awards API
* Fix dig/place incrementing
* Use awards.player() in crates
* Use new 'dig' incrementor for digtron packing
* Only initialize tables if they dont exist
* Fix typo
* Remove init function, use checks instead
There have been reports of large, distant-from-player Digtrons apparently failing to completely write their layouts to the map, resulting in an inconsistency.
This adds an attempt to brute-force a solution. When a map write fails it will be retried until it succeeds, or until 1 second elapses (at which point the write is aborted in a hopefully somewhat clean manner).
This is basically working, but still needs revisions to take advantage
of the new information being stored in the image data. It should be
possible to do all the temporary inventory work directly on the image
file so that no put-back-in-inventory steps will be needed any more.
Much nicer.
Well that was a lot of work. Also, switched the "waiting" timer
management to the actual on_timer system - I noticed that minetest.after
wasn't persisting through server shutdown and restart, that could put a
controller in a "broken" state.