override func execute() {
guard let slotId = parameter["api_slotitem_id"].int
else { return print("api_slotitem_id is wrong") }
- guard let locked = data["api_locked"].bool
+ guard let locked = data["api_locked"].int
else { return print("api_locked is wrong") }
let store = ServerDataStore.oneTimeEditor()
- store.slotItem(byId: slotId)?.locked = locked
+ store.slotItem(byId: slotId)?.locked = locked != 0
}
}
guard let slotItem = store.slotItem(byId: slotItemId)
else { return print("SlotItem not found") }
- if let locked = afterSlot["api_locked"].bool {
- slotItem.locked = locked
+ if let locked = afterSlot["api_locked"].int {
+ slotItem.locked = locked != 0
}
if let masterSlotItemId = afterSlot["api_slotitem_id"].int,
masterSlotItemId != slotItem.slotitem_id,