← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-1670065_emp01_clear_building_site into lp:widelands

 

kaputtnik has proposed merging lp:~widelands-dev/widelands/bug-1670065_emp01_clear_building_site into lp:widelands.

Commit message:
Clear building space for Lumberjack in empire campaign 1

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1670065 in widelands: "random tree growth can block building sites needed to progress in scenario"
  https://bugs.launchpad.net/widelands/+bug/1670065

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1670065_emp01_clear_building_site/+merge/319000

Clear immovables close before the Lumberjack should be build to prevent blocking of buildings space due random seeding of trees.

First attempt to LUA scripting, please read carefully and may make some suggestions for doing it better :-)
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1670065_emp01_clear_building_site into lp:widelands.
=== modified file 'data/campaigns/emp01.wmf/scripting/mission_thread.lua'
--- data/campaigns/emp01.wmf/scripting/mission_thread.lua	2016-12-28 22:11:45 +0000
+++ data/campaigns/emp01.wmf/scripting/mission_thread.lua	2017-03-05 12:34:04 +0000
@@ -33,6 +33,17 @@
    set_objective_done(o)
 
    -- Blockhouse is completed now
+   -- Make sure no tree blocks the building space for Lumberjack
+   local fields = {{6,3},           -- Buildspace
+                   {7,4},           -- Flag of building
+                   {7,3}, {7,2},}   -- Roads
+   for k, v in pairs(fields) do
+       local f = wl.Game().map:get_field(v[1],v[2])
+       if f.immovable then
+           f.immovable:remove()
+       end
+    end
+
    campaign_message_box(saledus_2)
    p1:allow_buildings{"empire_lumberjacks_house"}
    o = add_campaign_objective(obj_build_lumberjack)


Follow ups