Refactor stash and targets behavior logic

Simplifies stash target assignment by returning early when registering a stash, ensuring consistent target setup. Enhances target update logic to check for removed targets and removes debug print statement.
This commit is contained in:
Mr.Crowley committed 2025-09-04 08:21:48 -05:00
1 parent 7443695254
commit debfb06231
2 files changed
+25 -19

No files matched your search

+7 -1
View File
@@ -61,8 +61,14 @@ function Targets.OnUpdate(entityData)
break
end
end
for k, v in pairs(entityData.oldTargets) do
if not entityData.targets or not entityData.targets[k] then
doesntMatch = true
break
end
end
if doesntMatch then
print("ASDFASDFASDF")
Targets.OnRemove(entityData)
Wait(100)
Targets.OnSpawn(entityData)