Invoking can return nil
Added fallback for current resource, future proofing against require and fixing entities target property
This commit is contained in:
1 parent
a34c7ba245
commit
ad8788bbfd
4 files changed
+15
-15
No files matched your search
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user