game: do not change smoothness for empty blocks

This commit is contained in:
Crypto City 2023-07-14 10:58:18 +00:00
parent 486691eab9
commit 732eab35d9

View File

@ -9249,7 +9249,7 @@ void CryptoCityUrho3D::HandleApproveBuild(StringHash eventType, VariantMap& even
const uint8_t previous_smoothness = h < original_smoothness[orgidx].size() ? original_smoothness[orgidx][h] : 0;
const uint8_t new_smoothness = h < flag_smoothness[orgidx].size() ? flag_smoothness[orgidx][h] : 0;
if (previous_smoothness != new_smoothness)
if (previous_smoothness != new_smoothness && new_block)
{
bx0s = std::min(bx0s, x);
by0s = std::min(by0s, y);
@ -9370,7 +9370,7 @@ void CryptoCityUrho3D::HandleApproveBuild(StringHash eventType, VariantMap& even
{
const uint8_t previous_smoothness = h < original_smoothness[orgidx].size() ? original_smoothness[orgidx][h] : 0;
const uint8_t new_smoothness = h < flag_smoothness[orgidx].size() ? flag_smoothness[orgidx][h] : 0;
tiles[idx] = (new_smoothness + 8 - previous_smoothness) % 8;
tiles[idx] = new_block ? (new_smoothness + 8 - previous_smoothness) % 8 : 0;
}
if (tiles[idx++])
changed = true;