<URL: http://bugs.freeciv.org/Ticket/Display.html?id=17191 >

Committed changes to 2.1 branch as r13098 and trunk as r13099.
Final patches attached.

Doing no spelling fixing since I don't know how that impacts 
translation. Two spelling errors in tutorial.sav remain in 2.1 branch.
Keeping this ticket open for that, patch to fix the spelling attached.
(spelling fixes by Daniel Markstedt)
Index: data/scenario/tutorial.sav
--- data/scenario/tutorial.sav	(revision 13098)
+++ data/scenario/tutorial.sav	(arbetskopia)
@@ -279,7 +279,7 @@
 _("You have built your first military unit!  Military units have two\n\
 basic purposes: attack and defense.  Each unit has an attack strength\n\
 and a defense strength.  While a Warriors is a measly 1/1, a Phalanx\n\
-is a must stronger defender with 2 defense (1/2).  A Catapult is a good\n\
+is a much stronger defender with 2 defense (1/2).  A Catapult is a good\n\
 attacking unit because it has 6 attack (6/1).\n\
 Usually it is a good idea to keep one or two defenders in each city.\n\
@@ -363,7 +363,7 @@
   if not hutmsg then
     notify.event(unit.owner, unit.tile, E.TUTORIAL,
 _("Your unit has found a Hut.  These are small villages scattered across\n\
-the landscape.  When a unit enters one several things may happen.  The\n\
+the landscape.  When a unit enters one, several things may happen.  The\n\
 most likely outcome is that you will find resources worth a small\n\
 amount of gold.  However it is also possible to find technologies or\n\
 mercenary units inside a hut.  Some huts contain native settlers\n\
Index: data/scenario/tutorial.sav
--- data/scenario/tutorial.sav	(revision 13097)
+++ data/scenario/tutorial.sav	(revision 13098)
@@ -5,6 +5,13 @@
+function has_unit_type_name(unit, utype_name) 
+  return (unit.utype.id == find.unit_type(utype_name).id)
+function has_tile_terrain_name(tile, terrain_name)
+  return (tile.terrain.id == find.terrain(terrain_name).id)
 function turn_callback(turn, year)
   if turn == 0 then
     notify.event(nil, nil, E.TUTORIAL,
@@ -20,9 +27,9 @@
 function unit_moved_callback(unit, src_tile, dst_tile)
   if unit.owner:is_human() then
     if citiesbuilt == 0
-      and unit:type().name == 'Settlers'
-      and (dst_tile:terrain().name == 'Grassland'
-           or dst_tile:terrain().name == 'Plains') then  
+      and has_unit_type_name(unit, 'Settlers')
+      and (has_tile_terrain_name(dst_tile, 'Grassland')
+           or has_tile_terrain_name(dst_tile, 'Plains')) then  
       notify.event(unit.owner, dst_tile, E.TUTORIAL,
 _("This looks like a good place to build a city.  The next time this\n\
 unit gets a chance to move, press (b) to found a city.\n\
@@ -195,7 +202,7 @@
   if not unit.owner:is_human() then
-  if unit:type().name == 'Settlers' then
+  if has_unit_type_name(unit, 'Settlers') then
     if settlersbuilt == 0 then
       notify.event(unit.owner, unit.tile, E.TUTORIAL,
 _("You have built a settler unit.  Settlers are best used to build \n\
@@ -233,7 +240,7 @@
   if not city.owner:is_human() then
-  if building.name == 'Barracks' and not barracksmsg then
+  if building.id == find.building_type('Barracks').id and not barracksmsg then
     notify.event(city.owner, city.tile, E.TUTORIAL,
 _("You have built a Barracks.  This building will make any military\n\
 units you build start out as veterans.  Veteran units are stronger\n\
@@ -255,7 +262,7 @@
   if not city.owner:is_human() then
-  if unittype.name == 'Settlers' and not nosettlermsg then
+  if unittype.id == find.unit_type('Settlers').id and not nosettlermsg then
     notify.event(city.owner, city.tile, E.TUTORIAL,
 _("Your city cannot build a settler.  Settlers take one unit of\n\
 population to build, so a city of size one cannot build one without\n\
Freeciv-dev mailing list

Reply via email to