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:
1 parent
7443695254
commit
debfb06231
2 files changed
+25
-19
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user