                      :unit-type/movement (:movement unit-def)
                      :unit-type/min-range (:min-range unit-def)
                      :unit-type/max-range (:max-range unit-def)
-                     :unit-type/armor-type (-> unit-def :armor-type to-armor-type)
+                     :unit-type/armor-type (:armor-type unit-def)
                      :unit-type/armor armor
                      :unit-type/capturing-armor (or capturing-armor armor)
                      :unit-type/repair (:repair unit-def)

         :unit/state (e new-state)}])))
  ([db game q1 r1 q2 r2]
   (let [repairer (checked-unit-at db game q1 r1)
         wounded  (checked-unit-at db game q2 r2)]
     (repair-other-tx db game repairer wounded))))

(defn repair! [conn game-id q r]


(defn can-be-repaired? [db game unit]
  (< (:unit/count unit) (:game/max-count-per-unit game)))

(defn compatible-armor-types-for-repair?
  ([db game repairer wounded]
   (let [possible-repair-types (get-in repairer [:unit/type :unit-type/can-repair])
         goal-repair-type (get-in wounded [:unit/type :unit-type/armor-type])]
     (contains? possible-repair-types goal-repair-type))))

(defn repair-tx
  "Returns a transaction that increments unit count and sets the unit repaired
