Author: cazfi
Date: Tue Mar 17 07:31:51 2015
New Revision: 28571

URL: http://svn.gna.org/viewcvs/freeciv?rev=28571&view=rev
Log:
Fixed remaining boolea effects that were considering negative values TRUE.
- EFT_HAPPINESS_TO_GOLD
- EFT_NO_DIPLOMACY

See bug #23364

Modified:
    trunk/common/city.c
    trunk/common/player.c
    trunk/server/diplhand.c
    trunk/server/plrhand.c

Modified: trunk/common/city.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/city.c?rev=28571&r1=28570&r2=28571&view=diff
==============================================================================
--- trunk/common/city.c (original)
+++ trunk/common/city.c Tue Mar 17 07:31:51 2015
@@ -1929,7 +1929,7 @@
 {
   int tithes_bonus = 0;
 
-  if (!get_city_bonus(pcity, EFT_HAPPINESS_TO_GOLD)) {
+  if (!get_city_bonus(pcity, EFT_HAPPINESS_TO_GOLD) > 0) {
     return 0;
   }
 

Modified: trunk/common/player.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/player.c?rev=28571&r1=28570&r2=28571&view=diff
==============================================================================
--- trunk/common/player.c       (original)
+++ trunk/common/player.c       Tue Mar 17 07:31:51 2015
@@ -134,8 +134,8 @@
   if (p1 == p2) {
     return DIPL_ERROR; /* duh! */
   }
-  if (get_player_bonus(p1, EFT_NO_DIPLOMACY)
-      || get_player_bonus(p2, EFT_NO_DIPLOMACY)) {
+  if (get_player_bonus(p1, EFT_NO_DIPLOMACY) > 0
+      || get_player_bonus(p2, EFT_NO_DIPLOMACY) > 0) {
     return DIPL_ERROR;
   }
   if (treaty == DS_WAR 

Modified: trunk/server/diplhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/diplhand.c?rev=28571&r1=28570&r2=28571&view=diff
==============================================================================
--- trunk/server/diplhand.c     (original)
+++ trunk/server/diplhand.c     Tue Mar 17 07:31:51 2015
@@ -787,8 +787,8 @@
     return;
   }
 
-  if (get_player_bonus(pplayer, EFT_NO_DIPLOMACY)
-      || get_player_bonus(pother, EFT_NO_DIPLOMACY)) {
+  if (get_player_bonus(pplayer, EFT_NO_DIPLOMACY) > 0
+      || get_player_bonus(pother, EFT_NO_DIPLOMACY) > 0) {
     notify_player(pplayer, NULL, E_DIPLOMACY, ftc_server,
                   _("Your diplomatic envoy was decapitated!"));
     return;

Modified: trunk/server/plrhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/plrhand.c?rev=28571&r1=28570&r2=28571&view=diff
==============================================================================
--- trunk/server/plrhand.c      (original)
+++ trunk/server/plrhand.c      Tue Mar 17 07:31:51 2015
@@ -1946,8 +1946,8 @@
   ds_plr1plr2 = player_diplstate_get(pplayer1, pplayer2);
   ds_plr2plr1 = player_diplstate_get(pplayer2, pplayer1);
 
-  if (get_player_bonus(pplayer1, EFT_NO_DIPLOMACY) == 0
-      && get_player_bonus(pplayer2, EFT_NO_DIPLOMACY) == 0) {
+  if (get_player_bonus(pplayer1, EFT_NO_DIPLOMACY) <= 0
+      && get_player_bonus(pplayer2, EFT_NO_DIPLOMACY) <= 0) {
     ds_plr1plr2->contact_turns_left = game.server.contactturns;
     ds_plr2plr1->contact_turns_left = game.server.contactturns;
   }
@@ -2408,7 +2408,7 @@
     struct player_diplstate *ds_oc
       = player_diplstate_get(other_player, cplayer);
 
-    if (get_player_bonus(other_player, EFT_NO_DIPLOMACY)) {
+    if (get_player_bonus(other_player, EFT_NO_DIPLOMACY) > 0) {
       ds_co->type = DS_WAR;
       ds_oc->type = DS_WAR;
     } else {


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

Reply via email to