From 35eeaf4e9015d5fe835b74a776c29ef75d4182a1 Mon Sep 17 00:00:00 2001 From: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 13 Dec 2020 21:42:45 +0200 Subject: [PATCH] Fixed an issue where Pixelorama crashed when a user coming from a new version to an old one and had selected a tool that doesn't exist in an older version --- src/Autoload/Tools.gd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Autoload/Tools.gd b/src/Autoload/Tools.gd index ec1861443..e9b98e6d5 100644 --- a/src/Autoload/Tools.gd +++ b/src/Autoload/Tools.gd @@ -68,8 +68,12 @@ func _ready() -> void: _tool_buttons = Global.find_node_by_name(Global.control, "ToolButtons") var value = Global.config_cache.get_value(_slots[BUTTON_LEFT].kname, "tool", "Pencil") + if not value in _tools: + value = "Pencil" set_tool(value, BUTTON_LEFT) value = Global.config_cache.get_value(_slots[BUTTON_RIGHT].kname, "tool", "Eraser") + if not value in _tools: + value = "Eraser" set_tool(value, BUTTON_RIGHT) value = Global.config_cache.get_value(_slots[BUTTON_LEFT].kname, "color", Color.black) assign_color(value, BUTTON_LEFT, false)