Author: sveinung
Date: Wed Apr 16 16:25:16 2014
New Revision: 24770

URL: http://svn.gna.org/viewcvs/freeciv?rev=24770&view=rev
Log:
Explicitly return when a diplomat action query won't get the wanted information.

At the moment nothing is done after unit_query_impossible() is called. Add an
explicit return statement after all calls to it to make sure this won't change
by accident.

See patch #4653

Modified:
    trunk/server/unithand.c

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=24770&r1=24769&r2=24770&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Wed Apr 16 16:25:16 2014
@@ -326,6 +326,7 @@
     } else {
       illegal_action(pplayer, pdiplomat, ACTION_SPY_BRIBE_UNIT);
       unit_query_impossible(pc, diplomat_id, target_id);
+      return;
     }
     break;
   case DIPLOMAT_INCITE:
@@ -338,6 +339,7 @@
     } else {
       illegal_action(pplayer, pdiplomat, ACTION_SPY_INCITE_CITY);
       unit_query_impossible(pc, diplomat_id, target_id);
+      return;
     }
     break;
   case DIPLOMAT_SABOTAGE_TARGET:
@@ -349,11 +351,12 @@
       illegal_action(pplayer, pdiplomat,
                      ACTION_SPY_TARGETED_SABOTAGE_CITY);
       unit_query_impossible(pc, diplomat_id, target_id);
+      return;
     }
     break;
   default:
     unit_query_impossible(pc, diplomat_id, target_id);
-    break;
+    return;
   };
 }
 


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

Reply via email to