Author: cazfi
Date: Sat Dec 27 09:03:30 2014
New Revision: 27421

URL: http://svn.gna.org/viewcvs/freeciv?rev=27421&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:
    branches/S2_5/server/stdinhand.c

Modified: branches/S2_5/server/stdinhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/stdinhand.c?rev=27421&r1=27420&r2=27421&view=diff
==============================================================================
--- branches/S2_5/server/stdinhand.c    (original)
+++ branches/S2_5/server/stdinhand.c    Sat Dec 27 09:03:30 2014
@@ -5317,8 +5317,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 "
@@ -5339,8 +5340,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