Author: cazfi
Date: Sat Dec 27 09:03:22 2014
New Revision: 27420

URL: http://svn.gna.org/viewcvs/freeciv?rev=27420&view=rev
Log:
Fixed '/mapimg delete all' to really delete all and not only every second 
mapimg definition

Based on anonymous report

See bug #23095

Modified:
    trunk/server/stdinhand.c

Modified: trunk/server/stdinhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/stdinhand.c?rev=27420&r1=27419&r2=27420&view=diff
==============================================================================
--- trunk/server/stdinhand.c    (original)
+++ trunk/server/stdinhand.c    Sat Dec 27 09:03:22 2014
@@ -5248,8 +5248,9 @@
                   _("Can't use definition: %s."), mapimg_error());
         ret = FALSE;
       } else {
-        int id = mapimg_count() - 1;
         char str[MAX_LEN_MAPDEF];
+
+        id = mapimg_count() - 1;
 
         mapimg_id2str(id, str, sizeof(str));
         cmd_reply(CMD_MAPIMG, caller, C_OK, _("Defined as map image "
@@ -5270,8 +5271,8 @@
         goto cleanup;
       }
 
-      for (id = 0; id < mapimg_count(); id++) {
-        mapimg_delete(id);
+      while (mapimg_count() > 0) {
+        mapimg_delete(0);
       }
       cmd_reply(CMD_MAPIMG, caller, C_OK, _("All map image definitions "
                                             "deleted."));


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to