OSDN Git Service
(root)
/
kcd
/
KCD.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
12ec86c
)
複数の艦娘の解体、および装備を保管する解体に対応
author
masakih
<masakih@users.sourceforge.jp>
Mon, 11 Dec 2017 12:45:55 +0000
(21:45 +0900)
committer
masakih
<masakih@users.sourceforge.jp>
Mon, 11 Dec 2017 12:45:55 +0000
(21:45 +0900)
KCD/RealDestroyShipCommand.swift
patch
|
blob
|
history
diff --git
a/KCD/RealDestroyShipCommand.swift
b/KCD/RealDestroyShipCommand.swift
index
f5a52c2
..
1b28580
100644
(file)
--- a/
KCD/RealDestroyShipCommand.swift
+++ b/
KCD/RealDestroyShipCommand.swift
@@
-14,9
+14,21
@@
final class RealDestroyShipCommand: JSONCommand {
let store = ServerDataStore.oneTimeEditor()
- parameter["api_ship_id"]
- .int
+ let ships = parameter["api_ship_id"]
+ .array
+ .flatMap { $0.int }
.flatMap(store.ship(by:))
- .flatMap(store.delete)
+
+ if parameter["api_slot_dest_flag"].int == 0 {
+
+ // remove allEquipment
+ ships.forEach {
+ $0.equippedItem = []
+ $0.extraItem = nil
+ }
+ }
+
+ // destory ships
+ ships.forEach(store.delete)
}
}