editor crashes on map load

Bug #787217 reported by ismurk on 2011-05-23
This bug affects 2 people
Affects Status Importance Assigned to Milestone

Bug Description

Editor crashes without error message when loading the attached map. Map was created with same version of widelands (bzr5915). Map is playable.

ismurk (thomas-trathnigg) wrote :
Hans Joachim Desserud (hjd) wrote :

Hi ismurk, and welcom to Launchpad!

I tried loading the attached game in the editor, and I got the following error message:
allowed worker types: player 2 (barbarians): [widelands-path/src/profile/profile.cc:768] in section "" [player_2] not found

As you said the game is playable. I do not know the editor very well, but the error message indicate some problem with the allowed workers for one of the players. Have you done any scripting or changes to which workers should be available, or is this standard settings? Secondly, you mention the editor crash, which didn't happen for me. When I attempt to load the game in the editor I get a message box displaying the error after a while and I'm thrown back to the main menu, but the game is still running. Was this what you meant, or does the game actually exit when you encounter this problem?

Changed in widelands:
status: New → Confirmed
tags: added: editor
ismurk (thomas-trathnigg) wrote :

I started the editor from outside the game. Strange that i did not get the error message, the editor crashs without any error message. I can confirm your report when i load the editor from within the game.

The map is not modified by any scripting, just the standard settings.

Nasenbaer (nasenbaer) wrote :

The problem is indeed the allowed_worker_types file in the map.
Are you sure, you have not changed anything or copied files from another maps or the like?

Looking at the code, allowed_worker_types should only be written, if at least one player has at least one disallowed worker type. However in this case the file should held entries for every player, which it does not.
Furthermore, the entries it holds for player 1 are complete - no worker is disallowed, that is normally allowed...

So did you do anything "annormal" or specific that might have caused this problem?

Btw. if you want to fix the map, so you can load it - rename the file to xyz.zip, remove allowed_worker_types file from zip rerename it to the map file name (*.wmf)

Nasenbaer (nasenbaer) wrote :

okay okay :) - forget my question.

I found a way to reproduce this bug:
1) Create a map, save it, close Widelands
2) Reload the map (place all already existing player positions <- not sure if needed)
3) Add another player (and place it's start position <- as well not sure if needed ;) )
4) Save the map and close widelands.

now the map will be in the buggy state like the one of ismurk.

ismurk (thomas-trathnigg) wrote :

Hi Nasenbaer,

Your are right, first i placed no starting postions and after reloading the map i added the starting positions.

SirVer (sirver) wrote :

I will look into this eventually.

Changed in widelands:
importance: Undecided → High
assignee: nobody → SirVer (sirver)
milestone: none → build17-rc1
SirVer (sirver) on 2012-03-14
Changed in widelands:
milestone: build17-rc1 → none
Gunnar Mecke (gunnar-mecke) wrote :

Is there a workaround or a tool to repair such maps?

Hans Joachim Desserud (hjd) wrote :

Gunnar: Have you tried the workaround in comment #4? :)

Gunnar Mecke (gunnar-mecke) wrote :

oops sorry, missed that one

SirVer (sirver) wrote :

fixed this one in r6576.

I also changed that new workers are now allowed by default. This is important so that old maps allow to build (for example) a shipwright.

It is awkward for scenarios though - you might now be able to build new workers the scenario was not designed for. It is a smaller problem than the one we had before.

Changed in widelands:
assignee: SirVer (sirver) → nobody
status: Confirmed → Fix Committed
milestone: none → build18-rc1
SirVer (sirver) wrote :

Released in build-18 rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments