Change how class tables are created and recreated for greater robustness

This commit is contained in:
2023-03-17 13:31:10 -04:00
parent a8c780563f
commit 5ede3f507c
4 changed files with 71 additions and 46 deletions

View File

@@ -458,9 +458,11 @@ public:
void makeclass(LuaSlot tab, std::string_view name) const;
// Create a tangible, or look up an existing tangible.
// This doesn't do the entire process of tangible creation. It
// just creates an empty table, marks it as a tangible, creates
// the metatable, stores the tangible ID, and stores it in the tangible table.
// If the tangible doesn't exist yet, this creates a tangible stub.
// It is possible to use World::tangible_make to transform a tangible
// stub into a full blown tangible, and World::tangible_delete to turn
// a full-blown tangible back into a stub. A stub doesn't have a
// class or a thread table.
void maketan(LuaSlot tab, int64_t id) const;
// Return true if a tangible is empty (deleted or not yet created).