main.lua

changeset 134
ce945ba7a754
parent 132
e6df4368029d
child 135
0c1887ee2059
equal deleted inserted replaced
133:e087dd875160 134:ce945ba7a754
132 c = c + 1; 132 c = c + 1;
133 end 133 end
134 end 134 end
135 135
136 local function uninitialize_script(script) 136 local function uninitialize_script(script)
137 script.finished = true;
137 for name, obj in pairs(script.objects) do 138 for name, obj in pairs(script.objects) do
138 if obj.handler._finish then 139 if obj.handler._finish then
139 obj.handler._finish(obj); 140 obj.handler._finish(obj);
140 end 141 end
141 end 142 end
193 }); 194 });
194 195
195 if action_timeout and action_timeout > 0 then 196 if action_timeout and action_timeout > 0 then
196 local action_number = i; 197 local action_number = i;
197 verse.add_task(action_timeout, function () 198 verse.add_task(action_timeout, function ()
198 if i == action_number then 199 if i == action_number and not script.finished then
199 local e = new_error("action-timeout", { text = "Timeout waiting for response" }); 200 local e = new_error("action-timeout", { text = "Timeout waiting for response" });
200 error(e); 201 error(e);
201 end 202 end
202 end); 203 end);
203 end 204 end

mercurial