Mercurial > hg > batmud > chester
changeset 16:2369d74f50a1
Fix cleaning of containers.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 10 Jan 2011 09:18:11 +0200 |
parents | 2aa632a8610f |
children | bd6e836f9641 |
files | index.php |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/index.php Mon Jan 10 09:11:49 2011 +0200 +++ b/index.php Mon Jan 10 09:18:11 2011 +0200 @@ -455,6 +455,7 @@ statusMsg('Welcome to the editor. <b>(c) Copyright 2011 Matti Hämäläinen aka Ggr Pupunen.</b>'); } + function clearContainers() { var answer = confirm("Really clear (empty) all defined containers and reset item pool to original state?"); @@ -462,10 +463,17 @@ statusMsg("Clear operation cancelled."); return; } + initItems(); + for (var i = 0; i < list_containers.length; i++) { list_containers[i].items = []; + if (i == 0) { + curr_container = list_containers[i]; + curr_container.changed = true; + } } + updatePage(); }