Config.lua wrong precedence #13

Closed
opened 2024-07-11 00:56:12 +02:00 by AliasAlreadyTaken · 3 comments

The construction

yl_template.settings.debug = minetest.settings:get_bool("yl_template.debug") or true

does not work for booleans, only if the config setting is not configured (nil)

We need to test with ALL types

The construction ``` yl_template.settings.debug = minetest.settings:get_bool("yl_template.debug") or true ``` does not work for booleans, only if the config setting is not configured (nil) We need to test with ALL types
Member

Do you want something like:
yl_template.settings.debug = minetest.settings:get_bool("yl_template.debug") and true or false

or what do you mean?

Do you want something like: `yl_template.settings.debug = minetest.settings:get_bool("yl_template.debug") and true or false` or what do you mean?
Member

luaAPI says we are intended to use it like that: core.settings:get_bool("key", [default_value])

This was fixed in 839820e160

luaAPI says we are intended to use it like that: `core.settings:get_bool("key", [default_value])` This was fixed in https://gitea.your-land.de/your-land/yl_template/commit/839820e16056286bd3fd840a8a4cc3751fb0ea36
Member

Heh, can be closed then. Thanks :D

Heh, can be closed then. Thanks :D
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: your-land/yl_template#13
No description provided.