##// END OF EJS Templates
Fix a bug with kill-var and calling service locations
naryl -
r66:84186fb0 default
parent child Browse files
Show More
@@ -74,7 +74,7 b''
74 (defun call-serv-loc (var-name &rest args)
74 (defun call-serv-loc (var-name &rest args)
75 (let ((loc-name (get-global var-name 0)))
75 (let ((loc-name (get-global var-name 0)))
76 (when loc-name
76 (when loc-name
77 (let ((loc (getprop *locs loc-name)))
77 (let ((loc (getprop *locs (chain loc-name (to-upper-case)))))
78 (when loc
78 (when loc
79 (call-loc loc-name args))))))
79 (call-loc loc-name args))))))
80
80
@@ -225,13 +225,12 b''
225
225
226 (defun set-str-element (slot index value)
226 (defun set-str-element (slot index value)
227 (if (has index (getprop slot :indexes))
227 (if (has index (getprop slot :indexes))
228 (setf (elt (getprop slot)
228 (setf (elt slot (getprop slot :indexes index))
229 (getprop slot :indexes index))
230 value)
229 value)
231 (progn
230 (progn
232 (chain slot (push value))
231 (chain slot (push value))
233 (setf (elt slot index)
232 (setf (getprop slot :indexes index)
234 (length slot))))
233 (1- (length slot)))))
235 (void))
234 (void))
236
235
237 (defun set-any-element (slot index value)
236 (defun set-any-element (slot index value)
@@ -264,9 +263,11 b''
264 (defun kill-var (&optional name index)
263 (defun kill-var (&optional name index)
265 (cond (name
264 (cond (name
266 (setf name (chain name (to-upper-case)))
265 (setf name (chain name (to-upper-case)))
267 (if (and index (not (= 0 index)))
266 (cond ((and index (not (= 0 index)))
268 (chain (getprop *globals name) (kill index))
267 (chain (getprop *globals name) (kill index)))
269 (delete (getprop *globals name))))
268 (t
269 (setf (getprop *globals name) (list))
270 (setf (getprop *globals name "indexes") (create)))))
270 (t
271 (t
271 (setf *globals (create))
272 (setf *globals (create))
272 (init-globals *main-game)))
273 (init-globals *main-game)))
@@ -132,11 +132,10 b''
132 (api:add-text :main s)
132 (api:add-text :main s)
133 (void))
133 (void))
134
134
135 (defun maintxt (s)
135 (defun maintxt ()
136 (api:get-text :main)
136 (api:get-text :main))
137 (void))
138
137
139 (defun desc (s)
138 (defun desc ()
140 "")
139 "")
141
140
142 (defun main-clear ()
141 (defun main-clear ()
@@ -159,9 +158,8 b''
159 (api:add-text :stat s)
158 (api:add-text :stat s)
160 (void))
159 (void))
161
160
162 (defun stattxt (s)
161 (defun stattxt ()
163 (api:get-text :stat)
162 (api:get-text :stat))
164 (void))
165
163
166 (defun stat-clear ()
164 (defun stat-clear ()
167 (api:clear-text :stat)
165 (api:clear-text :stat)
General Comments 0
You need to be logged in to leave comments. Login now