7e4af1a01d82

Bugs
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sun, 08 Jan 2017 12:14:55 +0000
parents 0124edbf5a6f
children ae09c71d52e8
branches/tags (none)
files src/entities/player.lisp src/main.lisp

Changes

--- a/src/entities/player.lisp	Sun Jan 08 12:11:21 2017 +0000
+++ b/src/entities/player.lisp	Sun Jan 08 12:14:55 2017 +0000
@@ -29,7 +29,7 @@
 (defun make-player ()
   (create-entity 'player
     :coords/x (round (* 0.5 ap::*map-size*))
-    :coords/y (round (* 0.05 ap::*map-size*))
+    :coords/y (round (* 0.93 ap::*map-size*))
     :visible/glyph "@"
     :visible/color ap::+black-white+))
 
--- a/src/main.lisp	Sun Jan 08 12:11:21 2017 +0000
+++ b/src/main.lisp	Sun Jan 08 12:14:55 2017 +0000
@@ -272,7 +272,9 @@
 
 ;;;; Selection Menu -----------------------------------------------------------
 (defun key->index (key)
-  (- (char-code key) (char-code #\a)))
+  (if (characterp key)
+    (- (char-code key) (char-code #\a))
+    -1))
 
 (defun index->key (index)
   (code-char (+ (char-code #\a) index)))
@@ -450,8 +452,8 @@
 
 (defun eat ()
   (let ((food (remove-if-not (rcurry #'typep 'food)
-                             (append (player/inventory *player*)
-                                     (coords-nearby *player* 0)))))
+                             (append (coords-nearby *player* 0)
+                                     (player/inventory *player*)))))
     (cond ((null food)
            (popup "You don't have anything to eat."))
           ((> (player/energy *player*) 100.0)