"Assertion `c.x < width' failed" when loading smaller map in editor

Bug #1512151 reported by wl-zocker
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Low
Unassigned

Bug Description

Found in r7578 on Ubuntu 14.04.

Steps to reproduce:
- Go to the editor, load a relatively large map (or create a new, empty one).
- Move your screen to some coordinates with large numbers (e.g. 120|120). I do not know which point causes the problem.
- Within the editor, load a small map (e.g. Crater, 64x64).

Result:
Widelands crashes with the following message in the terminal:
widelands: ../src/logic/map.h:470: static Widelands::MapIndex Widelands::Map::get_index(const Widelands::Coords&, int16_t): Assertion `c.x < width' failed.

Program received signal SIGABRT, Aborted.

Backtrace attached.

It is interesting to notice that if the loaded map is large enough, the player sees the area around the old coordinates (120|120 in the above example), and not around (0|0) (default when the editor is started for the first time). I am not sure if we have always had this behavior.

Tags: crash editor

Related branches

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

I had the same behaviour

Changed in widelands:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
GunChleoc (gunchleoc) wrote :

We should reset the coordinates to 0, 0 when loading a map.

Nasenbaer (nasenbaer)
Changed in widelands:
milestone: none → build19-rc1
GunChleoc (gunchleoc)
Changed in widelands:
status: Confirmed → In Progress
assignee: nobody → GunChleoc (gunchleoc)
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

Bug attachments

Remote bug watches

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