Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

Commit fe91c8e

Browse files
committed
fix(marker): logical error when setting faceCamera
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.
1 parent aebef6d commit fe91c8e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

imports/marker/client.lua

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ local defaultRotation = vector3(0, 0, 0)
55
local defaultDirection = vector3(0, 0, 0)
66
local defaultColor = { r = 255, g = 255, b = 255, a = 100 }
77
local defaultSize = { width = 2, height = 1 }
8-
local defaultBobUpAndDown = false
9-
local defaultFaceCamera = true
10-
local defaultRotate = false
118
local defaultTextureDict = nil
129
local defaultTextureName = nil
1310

@@ -152,9 +149,9 @@ function lib.marker.new(options)
152149
self.height = options.height or defaultSize.height
153150
self.rotation = options.rotation or defaultRotation
154151
self.direction = options.direction or defaultDirection
155-
self.bobUpAndDown = options.bobUpAndDown or defaultBobUpAndDown
156-
self.faceCamera = options.faceCamera or defaultFaceCamera
157-
self.rotate = options.rotate or defaultRotate
152+
self.bobUpAndDown = type(options.bobUpAndDown) == 'boolean' and options.bobUpAndDown
153+
self.faceCamera = type(options.faceCamera) ~= 'boolean' or options.faceCamera
154+
self.rotate = type(options.rotate) == 'boolean' and options.rotate
158155
self.textureDict = options.textureDict or defaultTextureDict
159156
self.textureName = options.textureName or defaultTextureName
160157
self.draw = drawMarker

0 commit comments

Comments
 (0)