Author: sveinung
Date: Fri Feb 19 12:26:05 2016
New Revision: 31988

URL: http://svn.gna.org/viewcvs/freeciv?rev=31988&view=rev
Log:
Assert that all action orders can be saved.

See patch #6970

Modified:
    trunk/server/savegame3.c

Modified: trunk/server/savegame3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame3.c?rev=31988&r1=31987&r2=31988&view=diff
==============================================================================
--- trunk/server/savegame3.c    (original)
+++ trunk/server/savegame3.c    Fri Feb 19 12:26:05 2016
@@ -5660,6 +5660,10 @@
           break;
         case ORDER_PERFORM_ACTION:
           action_buf[j] = num2char(punit->orders.list[j].action);
+          /* Encoding with num2char() limits the number of actions. */
+          FC_STATIC_ASSERT(ACTION_COUNT <= strlen(num_chars),
+                           can_not_encode_all_actions);
+
           tgt_vec[j] = punit->orders.list[j].target;
           if (direction8_is_valid(punit->orders.list[j].dir)) {
             /* The action target is on another tile. */


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

Reply via email to