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.
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!