RPTools / maptool

Virtual Tabletop for playing roleplaying games with remote players or face to face.
http://rptools.net
GNU Affero General Public License v3.0
800 stars 262 forks source link

[Bug]: hasLightSource returns ERROR instead of 0 #4885

Closed Jmr3366 closed 4 weeks ago

Jmr3366 commented 2 months ago

Describe the Bug

hasLightSource can return Unknown light type "*" in function "hasLightSource". when the result should be 0

To Reproduce

Set a light source to a known value, like D20 Candle-5 [r: hasLightSource("D20","Candle - 5")] returns 1 [r: hasLightSource("D20","none")] returns 0 [r: hasLightSource("none","Candle - 5")] returns Unknown light type "none" in function "hasLightSource". [r: hasLightSource("*","Candle - 5")] returns 1 [r: hasLightSource("*","none")] returns Unknown light type "none" in function "hasLightSource".

Expected Behaviour

This should return 0 or 1 based off the values provided regardless of what exists in Lights.

If not possible, this error Unknown light type "none" in function "hasLightSource", _could fit_ if you do NOT use a*` (eg. set a "type" that does NOT exist).

Screenshots

No response

MapTool Info

1.15.0

Desktop

Win11

Additional Context

No response

Jmr3366 commented 4 weeks ago

This one should be closed