Merge lp:~widelands-dev/widelands/bug-1635932-trading-outpost-player-crash into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 8142
Proposed branch: lp:~widelands-dev/widelands/bug-1635932-trading-outpost-player-crash
Merge into: lp:widelands
Diff against target: 142 lines (+19/-22)
3 files modified
data/tribes/scripting/starting_conditions/atlanteans/trading_outpost.lua (+3/-4)
data/tribes/scripting/starting_conditions/barbarians/trading_outpost.lua (+11/-12)
data/tribes/scripting/starting_conditions/empire/trading_outpost.lua (+5/-6)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1635932-trading-outpost-player-crash
Reviewer Review Type Date Requested Status
SirVer Approve
Review via email: mp+309088@code.launchpad.net

Commit message

Fixed crash with player number and bug with building names in Trading Outpost starting condition.

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Bunnybot encountered an error while working on this merge proposal:

Running 'bzr branch lp:~widelands-dev/widelands/bug-1635932-trading-outpost-player-crash data/bzr_repo/_widelands_dev_widelands_bug_1635932_trading_outpost_player_crash' failed. Output:

bzr: ERROR: [Errno 122] Disk quota exceeded: u'/home/bunnybot/bunnybot/data/bzr_repo/_widelands_dev_widelands_bug_1635932_trading_outpost_player_crash/.bzr/checkout/limbo/new-13/world/critters/reindeer/reindeer_walk_w_10.png'

Revision history for this message
SirVer (sirver) wrote :

lgtm.

review: Approve
Revision history for this message
GunChleoc (gunchleoc) wrote :

@bunnybot merge

Revision history for this message
bunnybot (widelandsofficial) wrote :

Bunnybot encountered an error while working on this merge proposal:

Running 'bzr push :parent --overwrite' failed. Output:

Unable to obtain lock held by <email address hidden> on taotie (process #11861), acquired 67 hours, 24 minutes ago.
See "bzr help break-lock" for more.
bzr: ERROR: Could not acquire lock "(remote lock)": bzr+ssh://bazaar.launchpad.net/~widelands-dev/widelands/trunk/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/tribes/scripting/starting_conditions/atlanteans/trading_outpost.lua'
--- data/tribes/scripting/starting_conditions/atlanteans/trading_outpost.lua 2016-04-02 12:17:00 +0000
+++ data/tribes/scripting/starting_conditions/atlanteans/trading_outpost.lua 2016-10-23 09:52:24 +0000
@@ -108,11 +108,10 @@
108 })108 })
109109
110 -- Get all warehouse types110 -- Get all warehouse types
111 local plr = wl.Game().players[player.number]
112 local warehouse_types = {}111 local warehouse_types = {}
113 for i, building in ipairs(wl.Game():get_tribe_description(plr.tribe_name).buildings) do112 for i, building in ipairs(wl.Game():get_tribe_description(player.tribe_name).buildings) do
114 if (building.type_name == "warehouse") then113 if (building.type_name == "warehouse") then
115 table.insert(warehouse_types, building_name)114 table.insert(warehouse_types, building.name)
116 end115 end
117 end116 end
118117
@@ -125,7 +124,7 @@
125 -- collect all ~warehouses and pick one to insert the wares124 -- collect all ~warehouses and pick one to insert the wares
126 local warehouses = {}125 local warehouses = {}
127 for i, building_name in ipairs(warehouse_types) do126 for i, building_name in ipairs(warehouse_types) do
128 warehouses = array_combine(warehouses, plr:get_buildings(building_name))127 warehouses = array_combine(warehouses, player:get_buildings(building_name))
129 end128 end
130129
131 if #warehouses > 0 then130 if #warehouses > 0 then
132131
=== modified file 'data/tribes/scripting/starting_conditions/barbarians/trading_outpost.lua'
--- data/tribes/scripting/starting_conditions/barbarians/trading_outpost.lua 2016-04-02 12:17:00 +0000
+++ data/tribes/scripting/starting_conditions/barbarians/trading_outpost.lua 2016-10-23 09:52:24 +0000
@@ -99,11 +99,10 @@
99 })99 })
100100
101 -- Get all warehouse types101 -- Get all warehouse types
102 local plr = wl.Game().players[player.number]
103 local warehouse_types = {}102 local warehouse_types = {}
104 for i, building in ipairs(wl.Game():get_tribe_description(plr.tribe_name).buildings) do103 for i, building in ipairs(wl.Game():get_tribe_description(player.tribe_name).buildings) do
105 if (building.type_name == "warehouse") then104 if (building.type_name == "warehouse") then
106 table.insert(warehouse_types, building_name)105 table.insert(warehouse_types, building.name)
107 end106 end
108 end107 end
109108
@@ -116,7 +115,7 @@
116 -- collect all ~warehouses and pick one to insert the wares115 -- collect all ~warehouses and pick one to insert the wares
117 local warehouses = {}116 local warehouses = {}
118 for i, building_name in ipairs(warehouse_types) do117 for i, building_name in ipairs(warehouse_types) do
119 warehouses = array_combine(warehouses, plr:get_buildings(building_name))118 warehouses = array_combine(warehouses, player:get_buildings(building_name))
120 end119 end
121120
122 if #warehouses > 0 then121 if #warehouses > 0 then
@@ -129,23 +128,23 @@
129 local wh = warehouses[idx]128 local wh = warehouses[idx]
130 local added = 0129 local added = 0
131130
132 if plr:get_wares("water") < 40 + #warehouses * 10 then131 if player:get_wares("water") < 40 + #warehouses * 10 then
133 wh:set_wares("water", wh:get_wares("water") + 20 + #warehouses * 2)132 wh:set_wares("water", wh:get_wares("water") + 20 + #warehouses * 2)
134 added = added + 1133 added = added + 1
135 end134 end
136 if plr:get_wares("log") < 40 + #warehouses * 10 then135 if player:get_wares("log") < 40 + #warehouses * 10 then
137 wh:set_wares("log", wh:get_wares("log") + 20)136 wh:set_wares("log", wh:get_wares("log") + 20)
138 added = added + 1137 added = added + 1
139 end138 end
140 if plr:get_wares("granite") < 30 + #warehouses * 10 then139 if player:get_wares("granite") < 30 + #warehouses * 10 then
141 wh:set_wares("granite", wh:get_wares("granite") + 10 + #warehouses * 2)140 wh:set_wares("granite", wh:get_wares("granite") + 10 + #warehouses * 2)
142 added = added + 1141 added = added + 1
143 end142 end
144 if plr:get_wares("coal") < 70 + #warehouses * 10 then143 if player:get_wares("coal") < 70 + #warehouses * 10 then
145 wh:set_wares("coal", wh:get_wares("coal") + 25 + #warehouses * 5)144 wh:set_wares("coal", wh:get_wares("coal") + 25 + #warehouses * 5)
146 added = added + 1145 added = added + 1
147 end146 end
148 if plr:get_wares("iron_ore") < 30 + #warehouses * 10 then147 if player:get_wares("iron_ore") < 30 + #warehouses * 10 then
149 wh:set_wares("iron_ore", wh:get_wares("iron_ore") + 10 + #warehouses * 2)148 wh:set_wares("iron_ore", wh:get_wares("iron_ore") + 10 + #warehouses * 2)
150 added = added + 1149 added = added + 1
151 end150 end
@@ -153,15 +152,15 @@
153 wh:set_wares("fish", wh:get_wares("fish") + 10)152 wh:set_wares("fish", wh:get_wares("fish") + 10)
154 added = added + 1153 added = added + 1
155 end154 end
156 if plr:get_wares("gold") < 20 + #warehouses * 5 then155 if player:get_wares("gold") < 20 + #warehouses * 5 then
157 wh:set_wares("gold", wh:get_wares("gold") + 3)156 wh:set_wares("gold", wh:get_wares("gold") + 3)
158 added = added + 1157 added = added + 1
159 end158 end
160 if plr:get_wares("wheat") < 60 + #warehouses * 10 then159 if player:get_wares("wheat") < 60 + #warehouses * 10 then
161 wh:set_wares("wheat", wh:get_wares("wheat") + 15 + #warehouses * 2)160 wh:set_wares("wheat", wh:get_wares("wheat") + 15 + #warehouses * 2)
162 added = added + 1161 added = added + 1
163 end162 end
164 if plr:get_wares("barbarians_bread") < 40 + #warehouses * 5 then163 if player:get_wares("barbarians_bread") < 40 + #warehouses * 5 then
165 wh:set_wares("barbarians_bread", wh:get_wares("barbarians_bread") + 8 + #warehouses * 2)164 wh:set_wares("barbarians_bread", wh:get_wares("barbarians_bread") + 8 + #warehouses * 2)
166 added = added + 1165 added = added + 1
167 end166 end
168167
=== modified file 'data/tribes/scripting/starting_conditions/empire/trading_outpost.lua'
--- data/tribes/scripting/starting_conditions/empire/trading_outpost.lua 2016-04-02 12:17:00 +0000
+++ data/tribes/scripting/starting_conditions/empire/trading_outpost.lua 2016-10-23 09:52:24 +0000
@@ -105,11 +105,10 @@
105 })105 })
106106
107 -- Get all warehouse types107 -- Get all warehouse types
108 local plr = wl.Game().players[player.number]
109 local warehouse_types = {}108 local warehouse_types = {}
110 for i, building in ipairs(wl.Game():get_tribe_description(plr.tribe_name).buildings) do109 for i, building in ipairs(wl.Game():get_tribe_description(player.tribe_name).buildings) do
111 if (building.type_name == "warehouse") then110 if (building.type_name == "warehouse") then
112 table.insert(warehouse_types, building_name)111 table.insert(warehouse_types, building.name)
113 end112 end
114 end113 end
115114
@@ -122,7 +121,7 @@
122 -- collect all ~warehouses and pick one to insert the wares121 -- collect all ~warehouses and pick one to insert the wares
123 local warehouses = {}122 local warehouses = {}
124 for i, building_name in ipairs(warehouse_types) do123 for i, building_name in ipairs(warehouse_types) do
125 warehouses = array_combine(warehouses, plr:get_buildings(building_name))124 warehouses = array_combine(warehouses, player:get_buildings(building_name))
126 end125 end
127126
128 if #warehouses > 0 then127 if #warehouses > 0 then
@@ -159,11 +158,11 @@
159 if wh:get_wares("gold") < 50 then158 if wh:get_wares("gold") < 50 then
160 wh:set_wares("gold", wh:get_wares("gold") + 1)159 wh:set_wares("gold", wh:get_wares("gold") + 1)
161 end160 end
162 if plr:get_wares("wheat") < 60 + #warehouses * 10 then161 if player:get_wares("wheat") < 60 + #warehouses * 10 then
163 wh:set_wares("wheat", wh:get_wares("wheat") + 10 + #warehouses * 2)162 wh:set_wares("wheat", wh:get_wares("wheat") + 10 + #warehouses * 2)
164 added = added + 1163 added = added + 1
165 end164 end
166 if plr:get_wares("flour") < 30 + #warehouses * 10 then165 if player:get_wares("flour") < 30 + #warehouses * 10 then
167 wh:set_wares("flour", wh:get_wares("flour") + #warehouses * 5)166 wh:set_wares("flour", wh:get_wares("flour") + #warehouses * 5)
168 added = added + 1167 added = added + 1
169 end168 end

Subscribers

People subscribed via source and target branches

to status/vote changes: