News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

BUG: field's height can be changed unlimitedly

Started by poppo, September 08, 2026, 02:29:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

poppo

in tool_setslope_t, we check the height differences from the adjacent tiles. But the tile with field of factory, this check was skipped:
// check, if action is valid ...
const sint16 hgt=new_pos.z;
// maximum difference check with tiles to north, south east and west
const sint8 test_hgt = hgt+(new_slope!=0);

- if(  gr1->get_typ()==grund_t::boden  ) {
+ if(  gr1->get_typ()==grund_t::boden  ||  gr1->get_typ()==grund_t::fundament  ) {
for(  sint16 i = 0 ;  i < 4 ;  i++  ) {
const koord neighbour = k + koord::nesw[i];
grund_t::fundament means there is a building or fields, but in building case, returned early.

victor_18993

Thanks, Poppo! Your fix is now integrated in r12276.

I reproduced the issue and added a regression test covering raising and lowering factory fields, including repeated rejected attempts without changes to the terrain or player funds.

The full suite passes locally (311/311); the GitHub CI run is still in progress. Thanks for spotting this and providing the fix!
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)