match prior case convention for swap and trash slots

This commit is contained in:
Zithia Satazaki 2023-10-30 14:48:45 -04:00
parent 7eb1cd8dd9
commit 8aeed2baa8

View File

@ -12,17 +12,17 @@ LuaValue LuaConverter<InventorySlot>::from(LuaEngine& engine, InventorySlot k) {
return table;
}
else if (k.is<SwapSlot>())
return engine.createString("Swap");
return engine.createString("swap");
else if (k.is<TrashSlot>())
return engine.createString("Trash");
return engine.createString("trash");
}
Maybe<InventorySlot> LuaConverter<InventorySlot>::to(LuaEngine&, LuaValue const& v) {
if (auto str = v.ptr<LuaString>()) {
auto string = str->toString();
if (string.equalsIgnoreCase("Swap"))
if (string.equalsIgnoreCase("swap"))
return SwapSlot();
else if (string.equalsIgnoreCase("Trash"))
else if (string.equalsIgnoreCase("trash"))
return TrashSlot();
else if (auto equipment = EquipmentSlotNames.leftPtr(str->toString()))
return *equipment;