Invoking can return nil

Added fallback for current resource, future proofing against require and fixing entities target property
This commit is contained in:
Mr.Crowley committed 2026-08-14 17:38:09 -05:00
1 parent a34c7ba245
commit ad8788bbfd
4 files changed
+15 -15

No files matched your search

+2 -2
View File
@@ -182,7 +182,7 @@ function Target.AddBoxZone(name, coords, size, heading, options, debug)
options = options,
distance = getLargestDistance(options),
})
table.insert(targetZones, { name = name, creator = GetInvokingResource() })
table.insert(targetZones, { name = name, creator = GetInvokingResource() or GetCurrentResourceName() })
return name
end
@@ -200,7 +200,7 @@ function Target.AddSphereZone(name, coords, radius, options, debug)
options = options,
distance = getLargestDistance(options),
})
table.insert(targetZones, { name = name, creator = GetInvokingResource() })
table.insert(targetZones, { name = name, creator = GetInvokingResource() or GetCurrentResourceName() })
return name
end