Latest Posts

Topic: Place port per Lua crashes the game

MarkMcWire
Avatar
Joined: 2017-02-08, 21:06
Posts: 196
Ranking
Widelands-Forum-Junkie
Location: Eisenach, Germany
Posted at: 2020-11-26, 11:43

*** # place_port(4,170,182)
*** Starting Lua interpretation!
Forcing flag at (170, 182)
Message: adding warehouse for player 4 at (169, 181)
Attempting to setup port without neighboring water (coords: 169x181).
AddressSanitizer:DEADLYSIGNAL

How can I prevent this? My Lua-Code uses the place_building_in_region-function from infrastructure.lua. I used the coordinates on map, which has a port space. Instead of crashing, the game should refuse a try of build a port, if no neighboring water, or ignore it.

Edited: 2020-11-26, 11:49

My widelands project: https://github.com/MarkMcWire/widelands

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1152
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-11-26, 11:49

Build-21? This should be fixed in master already: https://github.com/widelands/widelands/pull/3994


Top Quote
MarkMcWire
Avatar
Joined: 2017-02-08, 21:06
Posts: 196
Ranking
Widelands-Forum-Junkie
Location: Eisenach, Germany
Posted at: 2020-11-26, 11:50

Nordfriese wrote:

Build-21? This should be fixed in master already: https://github.com/widelands/widelands/pull/3994

Yes, Build 21.


My widelands project: https://github.com/MarkMcWire/widelands

Top Quote