diff --git a/src/api.ps b/src/api.ps --- a/src/api.ps +++ b/src/api.ps @@ -74,7 +74,7 @@ (defun call-serv-loc (var-name &rest args) (let ((loc-name (get-global var-name 0))) (when loc-name - (let ((loc (getprop *locs loc-name))) + (let ((loc (getprop *locs (chain loc-name (to-upper-case))))) (when loc (call-loc loc-name args)))))) @@ -225,13 +225,12 @@ (defun set-str-element (slot index value) (if (has index (getprop slot :indexes)) - (setf (elt (getprop slot) - (getprop slot :indexes index)) + (setf (elt slot (getprop slot :indexes index)) value) (progn (chain slot (push value)) - (setf (elt slot index) - (length slot)))) + (setf (getprop slot :indexes index) + (1- (length slot))))) (void)) (defun set-any-element (slot index value) @@ -264,9 +263,11 @@ (defun kill-var (&optional name index) (cond (name (setf name (chain name (to-upper-case))) - (if (and index (not (= 0 index))) - (chain (getprop *globals name) (kill index)) - (delete (getprop *globals name)))) + (cond ((and index (not (= 0 index))) + (chain (getprop *globals name) (kill index))) + (t + (setf (getprop *globals name) (list)) + (setf (getprop *globals name "indexes") (create))))) (t (setf *globals (create)) (init-globals *main-game))) diff --git a/src/intrinsics.ps b/src/intrinsics.ps --- a/src/intrinsics.ps +++ b/src/intrinsics.ps @@ -132,11 +132,10 @@ (api:add-text :main s) (void)) -(defun maintxt (s) - (api:get-text :main) - (void)) +(defun maintxt () + (api:get-text :main)) -(defun desc (s) +(defun desc () "") (defun main-clear () @@ -159,9 +158,8 @@ (api:add-text :stat s) (void)) -(defun stattxt (s) - (api:get-text :stat) - (void)) +(defun stattxt () + (api:get-text :stat)) (defun stat-clear () (api:clear-text :stat)