From 8891c47e983d5315bc5be3bcfdc31aa1953e5d80 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Tue, 13 Jul 2021 00:22:35 +0100 Subject: [PATCH] wea.parse.map: fix crash if keywords isn't specified --- worldeditadditions/utils/parse/map.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worldeditadditions/utils/parse/map.lua b/worldeditadditions/utils/parse/map.lua index 58e311d..94bc360 100644 --- a/worldeditadditions/utils/parse/map.lua +++ b/worldeditadditions/utils/parse/map.lua @@ -4,9 +4,10 @@ local wea = worldeditadditions -- For example, "count 25000 speed 0.8 rate_erosion 0.006 doawesome true" would be parsed into -- the following table: { count = 25000, speed = 0.8, rate_erosion = 0.006, doawesome = true }. -- @param params_text string The string to parse. --- @param keywords string[] A list of keywords. Keywords can be present on their own without a value. If found, their value will be automatically set to bool true. +-- @param keywords string[]? Optional. A list of keywords. Keywords can be present on their own without a value. If found, their value will be automatically set to bool true. -- @returns table A table of key-value pairs parsed out from the given string. function worldeditadditions.parse.map(params_text, keywords) + if not keywords then keywords = {} end local result = {} local parts = wea.split(params_text, "%s+", false)