Lua struct obj improvements

If the core frees the obj struct referred by lua, don't free it,
just mark it as OBJ_LUAFREE - lua will free it in gc once all
the references to it are gone.
This commit is contained in:
Pasi Kallinen
2020-01-01 13:25:55 +02:00
parent 2ae7cf02ea
commit 7e07cef197
5 changed files with 58 additions and 30 deletions

View File

@@ -66,7 +66,8 @@ struct obj {
#define OBJ_MIGRATING 5 /* object sent off to another level */
#define OBJ_BURIED 6 /* object buried */
#define OBJ_ONBILL 7 /* object on shk bill */
#define NOBJ_STATES 8
#define OBJ_LUAFREE 8 /* object has been dealloc'd, but is ref'd by lua */
#define NOBJ_STATES 9
xchar timed; /* # of fuses (timers) attached to this obj */
Bitfield(cursed, 1);