Crash during battle in editor_game_base.cc:677

Bug #1542703 reported by kaputtnik
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
widelands
Fix Released
High
Unassigned

Bug Description

This was reported in the forum https://wl.widelands.org/forum/topic/1931/ :

I get a crash in widelands revision #7782. I think I tracked it down to an attack on a certain military site of the blue player. In the savegame at http://pholia.tdi.informatik.uni-frankfurt.de/~philipp/widelands/PkK%202.wgf the attack is already underway, and the crash happens a few tens of seconds after loading the game during combat (loaded savegame three times, each time the crash happened when the first blue soldier's health first went below 50%).

widelands: ../src/logic/editor_game_base.cc:677: virtual void Widelands::EditorGameBase::do_conquer_area(Widelands::PlayerArea<Widelands::Area<Widelands::FCoords> >, bool, Widelands::PlayerNumber, bool, bool, bool): Zusicherung »preferred_player != player_area.player_number« nicht erfüllt.

I could confirm this with r7788 and the attached savegame.

Importance "High" because of crash.

Related branches

Revision history for this message
kaputtnik (franku) wrote :
Revision history for this message
GunChleoc (gunchleoc) wrote :

It might be the same as this bug:

https://bugs.launchpad.net/widelands/+bug/1251788

Good to have a current savegame though :)

Revision history for this message
SirVer (sirver) wrote :

The problem is that a port is finished at (188, 114) for the red player. The code immediately burns it down again and that crashes.

This is the underlying problem:

1) A player never looses land if she has military influence over it.
2) The game does not allow buildings that are on the border - all fields of a building must be fully inside a players land.
3) ports seem to relax assumption 2 (see screenshot). The port only conquers a small amount of land, which does not fully cover it's area.

When the port is finished, the initialization conquers area which checks that all buildings are indeed inside the owned land. Since purples borders cannot move, the port is on the border and gets killed immediately again - and that crashes the assert.

Revision history for this message
SirVer (sirver) wrote :

Second screenshot: I manually disabled the check that buildings cannot be on the border - so the port is not burned down after finshing.

I am not sure how to fix this issue.

1) Relax assumption 1) and give the port upon building more conquered land so that when it finishes it does not burn down. This might burn down buildings of the neighbor who looses land without military influence.
2) forbid a port space to be placed there in the first place.

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

So the same as bug 1534962.

See by comment #5 there. I prefer for suggestion 2 (forbid a port space to be placed there in the first place).

Revision history for this message
GunChleoc (gunchleoc) wrote :

In the long run, we will want https://bugs.launchpad.net/widelands/+bug/536583

That will be a big change though, so maybe what #5 suggested might be the better option, so we can get the release out.

SirVer (sirver)
Changed in widelands:
assignee: nobody → SirVer (sirver)
status: Confirmed → In Progress
Revision history for this message
TiborB (tiborb95) wrote :

I am attaching a screenshot of two ports with overlapping portdocks - of course portdocks are not visible... for discussion in merge request

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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