Author: cazfi
Date: Tue Mar 17 07:32:09 2015
New Revision: 28573

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

See bug #23364

Modified:
    branches/S2_5/common/city.c
    branches/S2_5/common/player.c
    branches/S2_5/server/diplhand.c
    branches/S2_5/server/plrhand.c

Modified: branches/S2_5/common/city.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/common/city.c?rev=28573&r1=28572&r2=28573&view=diff
==============================================================================
--- branches/S2_5/common/city.c (original)
+++ branches/S2_5/common/city.c Tue Mar 17 07:32:09 2015
@@ -1965,7 +1965,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: branches/S2_5/common/player.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/common/player.c?rev=28573&r1=28572&r2=28573&view=diff
==============================================================================
--- branches/S2_5/common/player.c       (original)
+++ branches/S2_5/common/player.c       Tue Mar 17 07:32:09 2015
@@ -141,8 +141,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: branches/S2_5/server/diplhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/diplhand.c?rev=28573&r1=28572&r2=28573&view=diff
==============================================================================
--- branches/S2_5/server/diplhand.c     (original)
+++ branches/S2_5/server/diplhand.c     Tue Mar 17 07:32:09 2015
@@ -770,8 +770,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: branches/S2_5/server/plrhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/plrhand.c?rev=28573&r1=28572&r2=28573&view=diff
==============================================================================
--- branches/S2_5/server/plrhand.c      (original)
+++ branches/S2_5/server/plrhand.c      Tue Mar 17 07:32:09 2015
@@ -1897,8 +1897,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;
   }
@@ -2359,7 +2359,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