From bc8ba05fc1837e2421e7b53420b655c7806c006a Mon Sep 17 00:00:00 2001 From: jsancho Date: Sat, 7 Nov 2009 17:17:22 +0000 Subject: [PATCH] --- gacela.lisp | 22 +++++++--------------- gacela_mobs.lisp | 3 ++- 2 files changed, 9 insertions(+), 16 deletions(-) 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))) -- 2.39.2