Fix walking off-map
This commit is contained in:
parent
a73dcad7ea
commit
c7ad52e94f
|
@ -299,7 +299,7 @@ Very kindly removes a list of parameters to be returned by the overworld state-f
|
||||||
;; Change the entity’s world coordinates…
|
;; Change the entity’s world coordinates…
|
||||||
(when (walkable-tile-p map x y)
|
(when (walkable-tile-p map x y)
|
||||||
(setf (getf (getf-entity-data map entity :coords) :x) x)
|
(setf (getf (getf-entity-data map entity :coords) :x) x)
|
||||||
(setf (getf (getf-entity-data map entity :coords) :y) y))
|
(setf (getf (getf-entity-data map entity :coords) :y) y)
|
||||||
;; If the entity’s moved into a different screen-chunk (and so into a different
|
;; If the entity’s moved into a different screen-chunk (and so into a different
|
||||||
;; sub-alist of MAP hash-table’s :entities), move its list into the new chunk’s.
|
;; sub-alist of MAP hash-table’s :entities), move its list into the new chunk’s.
|
||||||
(when (not (eq old-chunk new-chunk))
|
(when (not (eq old-chunk new-chunk))
|
||||||
|
@ -308,7 +308,7 @@ Very kindly removes a list of parameters to be returned by the overworld state-f
|
||||||
(cdr (getf-entity map entity)))
|
(cdr (getf-entity map entity)))
|
||||||
;; Delete it from the old list…
|
;; Delete it from the old list…
|
||||||
(alexandria:deletef (assoc-utils:aget (gethash :entities map) old-chunk) entity
|
(alexandria:deletef (assoc-utils:aget (gethash :entities map) old-chunk) entity
|
||||||
:test (lambda (id alist) (eq id (car alist)))))))
|
:test (lambda (id alist) (eq id (car alist))))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Ŝarĝante…
Reference in New Issue