diff --git a/autogen/lua_definitions/structs.lua b/autogen/lua_definitions/structs.lua index 5728a924e..b8fe5e2f8 100644 --- a/autogen/lua_definitions/structs.lua +++ b/autogen/lua_definitions/structs.lua @@ -2067,7 +2067,6 @@ --- @field public gfx GraphNodeObject --- @field public next ObjectNode --- @field public prev ObjectNode ---- @field public pool ObjectPoolNode --- @class ObjectPoolNode --- @field public pool Object[] diff --git a/docs/lua/structs.md b/docs/lua/structs.md index 4e229277e..ab2fd6e09 100644 --- a/docs/lua/structs.md +++ b/docs/lua/structs.md @@ -2688,7 +2688,6 @@ | gfx | [GraphNodeObject](structs.md#GraphNodeObject) | read-only | | next | [ObjectNode](structs.md#ObjectNode) | read-only | | prev | [ObjectNode](structs.md#ObjectNode) | read-only | -| pool | [ObjectPoolNode](structs.md#ObjectPoolNode) | | [:arrow_up_small:](#) diff --git a/include/types.h b/include/types.h index 6335f6b57..ea64ff19b 100644 --- a/include/types.h +++ b/include/types.h @@ -232,7 +232,6 @@ struct ObjectNode struct GraphNodeObject gfx; struct ObjectNode *next; struct ObjectNode *prev; - struct ObjectPoolNode* pool; }; // NOTE: Since ObjectNode is the first member of Object, it is difficult to determine diff --git a/src/game/spawn_object.c b/src/game/spawn_object.c index 99e43b2e8..0fb892535 100644 --- a/src/game/spawn_object.c +++ b/src/game/spawn_object.c @@ -155,7 +155,7 @@ static void deallocate_object(struct ObjectNode *obj) { if (obj->next) { obj->next->prev = obj->prev; } if (obj->prev) { obj->prev->next = obj->next; } - // Insert at beginning of free list + // Insert at beginning of the first available free list for (struct ObjectPoolNode* node = &gObjectPool; node != NULL; node = node->next) { if (node->freeList.next == NULL) { continue; } obj->next = node->freeList.next; @@ -181,8 +181,6 @@ void init_free_object_list(struct ObjectPoolNode* node) { // End the list obj->header.next = NULL; - // Attach pool - obj->header.pool = node; } /** diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c index fa625c65a..5ca1de801 100644 --- a/src/pc/lua/smlua_cobject_autogen.c +++ b/src/pc/lua/smlua_cobject_autogen.c @@ -2382,12 +2382,11 @@ static struct LuaObjectField sObjectHitboxFields[LUA_OBJECT_HITBOX_FIELD_COUNT] { "radius", LVT_S16, offsetof(struct ObjectHitbox, radius), false, LOT_NONE, 1, sizeof(s16) }, }; -#define LUA_OBJECT_NODE_FIELD_COUNT 4 +#define LUA_OBJECT_NODE_FIELD_COUNT 3 static struct LuaObjectField sObjectNodeFields[LUA_OBJECT_NODE_FIELD_COUNT] = { - { "gfx", LVT_COBJECT, offsetof(struct ObjectNode, gfx), true, LOT_GRAPHNODEOBJECT, 1, sizeof(struct GraphNodeObject) }, - { "next", LVT_COBJECT_P, offsetof(struct ObjectNode, next), true, LOT_OBJECTNODE, 1, sizeof(struct ObjectNode*) }, - { "pool", LVT_COBJECT_P, offsetof(struct ObjectNode, pool), false, LOT_OBJECTPOOLNODE, 1, sizeof(struct ObjectPoolNode*) }, - { "prev", LVT_COBJECT_P, offsetof(struct ObjectNode, prev), true, LOT_OBJECTNODE, 1, sizeof(struct ObjectNode*) }, + { "gfx", LVT_COBJECT, offsetof(struct ObjectNode, gfx), true, LOT_GRAPHNODEOBJECT, 1, sizeof(struct GraphNodeObject) }, + { "next", LVT_COBJECT_P, offsetof(struct ObjectNode, next), true, LOT_OBJECTNODE, 1, sizeof(struct ObjectNode*) }, + { "prev", LVT_COBJECT_P, offsetof(struct ObjectNode, prev), true, LOT_OBJECTNODE, 1, sizeof(struct ObjectNode*) }, }; #define LUA_OBJECT_POOL_NODE_FIELD_COUNT 3