From: jsancho Date: Sat, 7 Nov 2009 17:17:22 +0000 (+0000) Subject: (no commit message) X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=bc8ba05fc1837e2421e7b53420b655c7806c006a;p=gacela.git --- diff --git a/gacela.lisp b/gacela.lisp index fb8438b..a98446b 100644 --- a/gacela.lisp +++ b/gacela.lisp @@ -213,24 +213,16 @@ (when (and socket (si::listen socket)) (push (si:accept socket) clients))) (defun eval-from-clients () - (dolist (cli clients) (when (si::listen cli) (eval (read cli)))))) + (dolist (cli clients) (when (si::listen cli) (eval (read cli))))) + (defun stop-server () + (when socket + (dolist (cli clients) (si::close cli)) + (si::close socket) + (setq socket nil clients nil)))) -;;; GaCeLa Functions -(let (commands) - (defun prog-command (command) - (setq commands (cons command commands))) - - (defun run-commands () - (cond (commands - (let (running) - (setq running commands) - (setq commands nil) - (labels ((run-com (comlst) - (cond (comlst (run-com (cdr comlst)) - (eval (read-from-string (concatenate 'string "(progn " (car comlst) ")"))))))) - (run-com running))))))) +;;; GaCeLa Functions (let (time (time-per-frame (/ 1000.0 *frames-per-second*))) (defun set-frames-per-second (fps) (setq time-per-frame (/ 1000.0 fps))) diff --git a/gacela_mobs.lisp b/gacela_mobs.lisp index 3c6fec0..0b84411 100755 --- a/gacela_mobs.lisp +++ b/gacela_mobs.lisp @@ -47,7 +47,8 @@ (do ((mob (pop mobs-to-add) (pop mobs-to-add))) ((null mob)) (push mob running-mobs) (funcall (symbol-function mob) :init)) - (setq running-mobs (reverse (set-difference running-mobs mobs-to-quit)))) + (setq running-mobs (reverse (set-difference running-mobs mobs-to-quit))) + (setq mobs-to-quit nil)) (defun quit-all-mobs () (setq running-mobs nil mobs-to-add nil mobs-to-quit nil)))