Wincondition artifacts could be choosen if no artifacts are available in map

Bug #1525706 reported by kaputtnik
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Undecided
Unassigned

Bug Description

Seen in r7669.

Steps to reproduce:

1. Start editor
2. Place a player
3. Save the map
4. Start a game and chose the previous saved map

Result: Win condition artifact could be chosen.

The tag "artifacts" is always stored in the "elemental" file of the map.

Related branches

Revision history for this message
wl-zocker (wl-zocker) wrote :

I can confirm this in r7662. Placing a player is not even necessary. There seems to be no way to get rid of the "artifacts" tag in the elemental file.

I am quite sure that this is a regression because when the feature was implemented, the win condition could only be chosen for maps with artifacts.

tags: added: editor regression
Changed in widelands:
status: New → Confirmed
Revision history for this message
GunChleoc (gunchleoc) wrote :

The bg is in the editor file writing I guess, so we might not have noticed it at the time.

Revision history for this message
kaputtnik (franku) wrote :

There is also another failure of editor file writing, but i haven't found how to reproduce it. Under some circumstances, after the players are set and the map is saved, reopening the map triggers the error:

Game data error
allowed buildings: player 2 (barbarians): [/home/kaputtnik/Quellcode/widelands-repo/trunk/src/profile/profile.cc:643] in "" section [player_2] not found

This is may caused by trying to set a player position to an invalid place, but this seems not to be the real reason for this error because it happens sometimes, sometimes not. I will file a new bugreport for this, if i found how to reproduce it.

Revision history for this message
wl-zocker (wl-zocker) wrote :

This bug happens indeed in r7627 (the revision in which the artifacts branch has been merged).

Revision history for this message
wl-zocker (wl-zocker) wrote :

I believe the problem is that all world immovables are checked, instead of just the ones on the map:
http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/logic/map.cc#L2067

If someone told be how to call this function for the whole map, I could try to fix it:
 uint32_t find_immovables
  (const Area<FCoords>,
   std::vector<ImmovableFound> * list,
   const FindImmovable & = find_immovable_always_true());

wl-zocker (wl-zocker)
Changed in widelands:
milestone: none → build19-rc1
Revision history for this message
kaputtnik (franku) wrote :

Just a reminder :-)

Revising maps for build 19 couldn't be done if this isn't fixed.... Otherwise one has to search each map and check if there are artifacts and maybe remove the tag "artifacts" from the elemental file by hand isn't really fun :D

GunChleoc (gunchleoc)
Changed in widelands:
assignee: nobody → GunChleoc (gunchleoc)
status: Confirmed → In Progress
Revision history for this message
kaputtnik (franku) wrote :

Crash when trying to select a map in Editor menu "Load map".

Revision history for this message
GunChleoc (gunchleoc) wrote :

This is the problem with the suggested teams box reported in https://bugs.launchpad.net/widelands/+bug/1543944

GunChleoc (gunchleoc)
Changed in widelands:
status: In Progress → Fix Committed
assignee: GunChleoc (gunchleoc) → nobody
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.