Author: cazfi
Date: Tue Mar  1 15:13:00 2016
New Revision: 32143

URL: http://svn.gna.org/viewcvs/freeciv?rev=32143&view=rev
Log:
Restored signal 'disaster' to have same parameters as in 2.5, and instead
introduced new 'disaster_occurred' signal with the new parameters. Marked 
'disaster'
deprecated.

See bug #24475

Modified:
    trunk/data/default/default.lua
    trunk/server/cityturn.c
    trunk/server/scripting/script_server.c

Modified: trunk/data/default/default.lua
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/default/default.lua?rev=32143&r1=32142&r2=32143&view=diff
==============================================================================
--- trunk/data/default/default.lua      (original)
+++ trunk/data/default/default.lua      Tue Mar  1 15:13:00 2016
@@ -204,4 +204,4 @@
   end
 end
 
-signal.connect("disaster", "_deflua_harmless_disaster_message")
+signal.connect("disaster_occurred", "_deflua_harmless_disaster_message")

Modified: trunk/server/cityturn.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/cityturn.c?rev=32143&r1=32142&r2=32143&view=diff
==============================================================================
--- trunk/server/cityturn.c     (original)
+++ trunk/server/cityturn.c     Tue Mar  1 15:13:00 2016
@@ -3740,10 +3740,13 @@
     }
   }
 
-  script_server_signal_emit("disaster", 3,
+  script_server_signal_emit("disaster_occurred", 3,
                             API_TYPE_DISASTER, pdis,
                             API_TYPE_CITY, pcity,
                             API_TYPE_BOOL, had_internal_effect);
+  script_server_signal_emit("disaster", 2,
+                            API_TYPE_DISASTER, pdis,
+                            API_TYPE_CITY, pcity);
 }
 
 /**************************************************************************

Modified: trunk/server/scripting/script_server.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/scripting/script_server.c?rev=32143&r1=32142&r2=32143&view=diff
==============================================================================
--- trunk/server/scripting/script_server.c      (original)
+++ trunk/server/scripting/script_server.c      Tue Mar  1 15:13:00 2016
@@ -414,8 +414,14 @@
   luascript_signal_create(fcl_main, "unit_lost", 3,
                           API_TYPE_UNIT, API_TYPE_PLAYER, API_TYPE_STRING);
 
-  luascript_signal_create(fcl_main, "disaster", 3,
+  luascript_signal_create(fcl_main, "disaster_occurred", 3,
                           API_TYPE_DISASTER, API_TYPE_CITY, API_TYPE_BOOL);
+
+  /* Deprecated form of the 'disaster_occurred' signal without 
'had_internal_effct'
+   * support. */
+  depr = luascript_signal_create(fcl_main, "disaster", 2,
+                          API_TYPE_DISASTER, API_TYPE_CITY);
+  deprecate_signal(depr, "disaster", "disaster_occurred", "2.6");
 
   luascript_signal_create(fcl_main, "achievement_gained", 3,
                           API_TYPE_ACHIEVEMENT, API_TYPE_PLAYER,


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

Reply via email to