From 7d463d6b53fb48eb8022bac9903ae5e6a656f8bf Mon Sep 17 00:00:00 2001 From: iakona <1824122+iakona@users.noreply.github.com> Date: Wed, 31 Mar 2021 21:34:05 -0500 Subject: [PATCH] Fixed scripting error for hotkeys to add defend isolate after game has started but a spirit hasn't been selected --- script.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script.lua b/script.lua index cf0749508..505f4b66b 100644 --- a/script.lua +++ b/script.lua @@ -2866,12 +2866,16 @@ function place(objName, placePos, droppingPlayerColor) return end elseif objName == "Defend Token" then - if droppingPlayerColor and selectedColors[droppingPlayerColor] then + if droppingPlayerColor and selectedColors[droppingPlayerColor] and selectedColors[droppingPlayerColor].defend ~= nil then temp = selectedColors[droppingPlayerColor].defend.takeObject({position = placePos,rotation = Vector(0,180,0)}) + else + return end elseif objName == "Isolate Token" then - if droppingPlayerColor and selectedColors[droppingPlayerColor] then + if droppingPlayerColor and selectedColors[droppingPlayerColor] and selectedColors[droppingPlayerColor].isolate ~= nil then temp = selectedColors[droppingPlayerColor].isolate.takeObject({position = placePos,rotation = Vector(0,180,0)}) + else + return end elseif objName == "1 Energy" then temp = oneEnergyBag.takeObject({position=placePos,rotation=Vector(0,180,0)})