Skip to content

Commit

Permalink
fix(marker): logical error when setting faceCamera
Browse files Browse the repository at this point in the history
Due to the way boolean values were being assigned, faceCamera would
always evaluate to true because of its default value. This change fixes
the logical error and ensures boolean properties are properly set.
  • Loading branch information
NotSomething0 committed Jan 7, 2025
1 parent aebef6d commit 7a1faf4
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions imports/marker/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ function lib.marker.new(options)
error(("expected marker type to have type 'string' or 'number' (received %s)"):format(type(options.type)))
end

if type(options.bobUpAndDown) ~= "boolean" then
options.bobUpAndDown = defaultBobUpAndDown
end

if type(options.faceCamera) ~= "boolean" then
options.faceCamera = defaultFaceCamera
end

if type(options.rotate) ~= "boolean" then
options.rotate = defaultRotate
end

local self = {}
self.type = markerType
self.coords = options.coords
Expand All @@ -152,9 +164,9 @@ function lib.marker.new(options)
self.height = options.height or defaultSize.height
self.rotation = options.rotation or defaultRotation
self.direction = options.direction or defaultDirection
self.bobUpAndDown = options.bobUpAndDown or defaultBobUpAndDown
self.faceCamera = options.faceCamera or defaultFaceCamera
self.rotate = options.rotate or defaultRotate
self.bobUpAndDown = options.bobUpAndDown
self.faceCamera = options.faceCamera
self.rotate = options.rotate
self.textureDict = options.textureDict or defaultTextureDict
self.textureName = options.textureName or defaultTextureName
self.draw = drawMarker
Expand Down

0 comments on commit 7a1faf4

Please sign in to comment.