OSDN Git Service

装備ロックが反映されない問題を修正した
authormasakih <masakih@users.sourceforge.jp>
Mon, 20 Mar 2017 12:32:47 +0000 (21:32 +0900)
committermasakih <masakih@users.sourceforge.jp>
Mon, 20 Mar 2017 12:32:47 +0000 (21:32 +0900)
KCD/KaisouLockCommand.swift
KCD/RemodelSlotItemCommand.swift

index 0d0fa45..140cb6a 100644 (file)
@@ -17,9 +17,9 @@ class KaisouLockCommand: JSONCommand {
     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
     }
 }
index 7d12814..990c347 100644 (file)
@@ -22,8 +22,8 @@ class RemodelSlotItemCommand: JSONCommand {
         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,