Refactor behavior and entity invocation handling

Standardizes the use of the 'invoked' property for entities and behaviors, ensuring behaviors are scoped per invoking resource. Updates behavior registration, retrieval, removal, and cleanup logic to support resource-specific behavior tables, improving modularity and preventing cross-resource conflicts.
This commit is contained in:
Mr.Crowley committed 2025-08-31 20:50:46 -05:00
1 parent b532e33fc7
commit c399fbaca4
3 files changed
+24 -19

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ function ServerEntity.New(id, entityType, model, coords, rotation, args)
self.coords = coords
self.rotation = rotation or vector3(0.0, 0.0, 0.0)
local invoking = GetInvokingResource() or "community_bridge"
self.invoking = invoking
self.invoked = invoking
Invoked[invoking] = Invoked[invoking] or {}
table.insert(Invoked[invoking], self)