← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/bug-1674243-crash_with_save_game into lp:widelands

 

I think this line is correct and should not be removed. This is the idea: to draw a road, you need to know the owner of the road to pull the road textures from its tribe. So f.owner must be set. 

In the changed function, the following is checked: this field was seen before by our current interactive player (pf.vision == 1), but it is no longer seen (otherwise pf.vision would be > 1). 

const Player::Field& pf = player->fields()[map.get_index(f.fcoords, map.get_width())];

pulls out the cached information about what the player last saw there and of course, if we last saw this field owned by player 2 (empire) we need to draw with empire textures - even though in reality the field might be owned by atlanteans by now (we do not know, we do not currently see the field). 

So the logic you remove seems correct to me. The more interesting question to me is why pf.owner == 0 though we apparently saw a road there before - this seems like it is not correct set on discovery of the node when we see it.



-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1674243-crash_with_save_game/+merge/324301
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1674243-crash_with_save_game into lp:widelands.


References