Work area radius: 45xxxxxxx in bzr7962[trunk]

Bug #1571009 reported by Klaus Halfmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Medium
Unassigned

Bug Description

Some Buildings show
Work area radius: 459874944

I found: Ax Workshop, Smelting Works, Charcoal Kiln, War Mill,

Bakery shows: Work area radius: 456396352
Big Inn: 454954656
Brewery: 458567408
etc.

To test open the help with f1 and scroll tgrough the Buildings Help.

Perhaps this was introduced via som type changes for uint8 to uint32 / ResourceAmount
and some calculations based on these.

Related branches

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :
Revision history for this message
Miroslav Remák (miroslavr256) wrote :

These buildings don't have a work area. The problem is that LuaBuildingDescription::get_workarea_radius doesn't check for that case and dereferences an invalid iterator. It should push a nil onto the stack when no work area is available.

kaputtnik (franku)
Changed in widelands:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
kaputtnik (franku) wrote :

For empire tribe the "workarea" isn't shown for such buildings. So i guess the culprit is somewhere in the Lua files?

Revision history for this message
Miroslav Remák (miroslavr256) wrote :

It's undefined whether it shows up or not. See my post. I don't think any Lua files are at fault here.

Revision history for this message
Miroslav Remák (miroslavr256) wrote :

Also see this condition:
      if(building_description.workarea_radius and building_description.workarea_radius > 0) then
         result = result .. text_line(_"Work area radius:", building_description.workarea_radius)
      end

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Ill try to fix this on a local branch, but I go back to work next Monday,
so maybe I will not have enough time to fix this.

Changed in widelands:
milestone: none → build19-rc1
status: Confirmed → In Progress
Revision history for this message
GunChleoc (gunchleoc) wrote :

Thanks for taking this on! If you don't manage to complete the fix and want somebody else to take over, you can push the branch and ping us in this bug.

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Hello Miroslav:

I failed to find this condition
> if(building_description.workarea_radius and building_description.workarea_radius > 0) then
> result = result .. text_line(_"Work area radius:", building_description.workarea_radius)
 (This hould be some lua code?)

Can you point me to the sources, please?

Revision history for this message
Miroslav Remák (miroslavr256) wrote :
GunChleoc (gunchleoc)
Changed in widelands:
status: In Progress → Fix Committed
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.