Topic: Place port per Lua crashes the game

MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06 UTC+1.0
Posts: 398
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2020-11-26, 11:43 UTC+1.0

*** # 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 UTC+1.0

My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07 UTC+1.0
Posts: 2171
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-11-26, 11:49 UTC+1.0

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


Top Quote
MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06 UTC+1.0
Posts: 398
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2020-11-26, 11:50 UTC+1.0

Nordfriese wrote:

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

Yes, Build 21.


My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote