Skip to content

Commit

Permalink
fix: don't vec3 if no postals, allow use in metadata with config flag
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanctech committed Feb 22, 2024
1 parent 11f56af commit 8768f05
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion callcommands/CHANGEMEconfig_callcommands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ local config = {
},
enablePanic = true,
-- adds an emergency call when panic button is pressed
addPanicCall = true
addPanicCall = true,

usePositionForMetadata = false,
}

if config.enabled then
Expand Down
10 changes: 9 additions & 1 deletion callcommands/sv_callcommands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@
if location == '' then
location = LocationCache[source] ~= nil and LocationCache[source].location or 'Unknown'
elseif type(location) == 'vector3' then
postal = getPostalFromVector3(location)
if isPluginLoaded("postals") then
postal = getPostalFromVector3(location)
else
postal = "Unknown"
end
end
-- send an event to be consumed by other resources
local uid = uuid()
Expand Down Expand Up @@ -181,6 +185,10 @@
data['metaData']['x'] = LocationCache[source].coordinates.x
data['metaData']['y'] = LocationCache[source].coordinates.y
data['metaData']['z'] = LocationCache[source].coordinates.z
elseif type(location) == "vector3" and pluginConfig.usePositionForMetadata then
data['metaData']['x'] = location.x
data['metaData']['y'] = location.y
data['metaData']['z'] = location.z
else
debugLog("Warning: location cache was nil, not sending position")
end
Expand Down
2 changes: 1 addition & 1 deletion callcommands/version_callcommands.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.7.2",
"version": "1.7.3",
"check_url": "https://raw.githubusercontent.com/Sonoran-Software/sonoran_callcommands/master/callcommands/version_callcommands.json",
"download_url": "https://github.com/Sonoran-Software/sonoran_callcommands/",
"minCoreVersion": "2.8.10",
Expand Down

0 comments on commit 8768f05

Please sign in to comment.