freeciv-server crash on additional building

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
taka
Posts: 12
Joined: Sat Oct 11, 2014 11:42 pm

freeciv-server crash on additional building

Postby taka » Thu Mar 12, 2015 11:38 pm

Hi,all.
I got a freeciv trouble when I wrote my rulesets.
This is a minimum ruleset to reproduce the crash. (for 2.5-RC1)

Details
Units:Strong Horsemen requires Buildings:Stable at Tech:Horseback Riding to build it. (impr_req = "Stable")
Server will crashe if AI player has completed research Tech:Horseback Riding.
I got the crash on both 2.5-RC1 and 2.4.
I got the crash on Windows gtk2 client, but I didn't get the crash on Linux gtk2 client.

Can you reproduce the crash on your environment?
Thank you.

Here is the difference between classic rulesets and horse test rulesets.

Code: Select all

diff -rNu classic/buildings.ruleset horse/buildings.ruleset
--- classic/buildings.ruleset   2015-02-26 03:07:44 +0900
+++ horse/buildings.ruleset   2015-03-09 20:53:48 +0900
@@ -1654,3 +1654,24 @@
  production to Coinage means its shield production is\
  converted to tax output (money, coins!).\
 ")
+
+[building_stable]
+name      = _("Stable")
+genus      = "Improvement"
+reqs   =
+    { "type", "name", "range"
+      "Tech", "Horseback Riding", "Player"
+    }
+graphic   = "b.barracks_iii"
+graphic_alt   = "-"
+obsolete_by   = "Tactics"
+build_cost   = 30
+upkeep      = 1
+sabotage   = 100
+sound      = "b_barracks_iii"
+sound_alt   = "b_generic"
+helptext   = _("\
+With a Stable, each new horse unit built in a city will\
+ automatically have Veteran status.\
+")
+
diff -rNu classic/effects.ruleset horse/effects.ruleset
--- classic/effects.ruleset   2015-03-05 16:48:19 +0900
+++ horse/effects.ruleset   2015-03-09 20:48:55 +0900
@@ -2357,3 +2357,19 @@
     { "type", "name", "range"
       "UnitFlag", "Transform", "Local"
     }
+
+
+[effect_Stable]
+type    = "Veteran_Build"
+value   = 1
+reqs   =
+    { "type", "name", "range"
+      "Building", "Stable", "City"
+      "UnitFlag", "Horse", "Local"
+    }
+nreqs   =
+    { "type", "name", "range"
+      "UnitFlag", "NonMil", "Local"
+      "UnitFlag", "NoVeteran", "Local"
+    }
+
diff -rNu classic/units.ruleset horse/units.ruleset
--- classic/units.ruleset   2015-02-26 03:07:44 +0900
+++ horse/units.ruleset   2015-03-09 20:54:54 +0900
@@ -2343,3 +2343,38 @@
 advanced radar that can determine the location of enemy units over a \
 wide area.\
 ")
+
+[unit_strong_horsemen]
+name          = _("Strong Horsemen")
+class         = "Land"
+tech_req      = "Horseback Riding"
+obsolete_by   = "Knights"
+impr_req      = "Stable"
+graphic       = "u.horsemen"
+graphic_alt   = "-"
+sound_move    = "m_horsemen"
+sound_move_alt = "m_generic"
+sound_fight   = "f_horsemen"
+sound_fight_alt = "f_generic"
+build_cost    = 20
+pop_cost      = 0
+attack        = 2
+defense       = 1
+hitpoints     = 20
+firepower     = 1
+move_rate     = 2
+vision_radius_sq = 2
+transport_cap = 0
+fuel          = 0
+uk_happy      = 1
+uk_shield     = 1
+uk_food       = 0
+uk_gold       = 0
+flags         = "Horse"
+roles         = "AttackFast", "Hut", "Barbarian", "Hunter"
+helptext      = _("\
+Horsemen are mounted warriors and an early\
+ shock-troop that can penetrate deep into\
+ enemy territory.\
+")
+
Attachments
horse-test.zip
horse test ruleset
(55.33 KiB) Downloaded 106 times