Skip to content

Commit f6ca0f6

Browse files
committed
Added a missing action to util/light_saves.hy.
1 parent f3a601d commit f6ca0f6

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

util/light_saves.hy

+17-6
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,29 @@ thousands of turns.]]
2222
:setv a state.action
2323
(ecase (type a)
2424
Wait ["Wait"]
25-
Walk ["Walk" a.direction.x a.direction.y]
26-
Shoot ["Shoot" a.direction.x a.direction.y]
27-
UseItem ["UseItem" a.item-ix a.target-x a.target-y])))))))
25+
Walk ["Walk"
26+
a.direction.x a.direction.y]
27+
Shoot ["Shoot"
28+
a.direction.x a.direction.y]
29+
UseItem ["UseItem"
30+
a.item-ix a.target-x a.target-y]
31+
UseControllableTeleporter ["UseControllableTeleporter"
32+
a.direction a.target-x a.target-y])))))))
2833

2934
(defn load [path]
35+
(defn d [xs]
36+
(get Direction.from-coords (tuple xs)))
37+
3038
(for [[atype #* args] (tqdm
3139
(hy.I.json.loads (hy.I.gzip.decompress (.read-bytes (Path path)))))]
3240
(take-turn (ecase atype
3341
"Wait" (Wait)
34-
"Walk" (Walk (get Direction.from-coords (tuple args)))
35-
"Shoot" (Shoot (get Direction.from-coords (tuple args)))
36-
"UseItem" (UseItem #* args)))))
42+
"Walk" (Walk (d args))
43+
"Shoot" (Shoot (d args))
44+
"UseItem" (UseItem #* args)
45+
"UseControllableTeleporter" (UseControllableTeleporter
46+
(d (get args 0))
47+
#* (cut args 1 None))))))
3748

3849

3950
(defmain [_ action path]

0 commit comments

Comments
 (0)