don't send nop txes

This commit is contained in:
Crypto City 2019-08-08 12:46:55 +00:00
parent 3ae27245b7
commit b239e62fae

View File

@ -952,6 +952,7 @@ void CryptoCityUrho3D::HandleApproveBuild(StringHash eventType, VariantMap& even
cmd.hm1 = flag->y1 - flag->y0;
cmd.min_height = h;
bool changed = false;
unsigned int idx = 0;
for (uint32_t y = flag->y0; y <= flag->y1; ++y)
{
@ -960,12 +961,18 @@ void CryptoCityUrho3D::HandleApproveBuild(StringHash eventType, VariantMap& even
const uint16_t prevth = flagUnderConstruction->second[idx].size();
const uint16_t th = flag->get_tile_height(x, y);
if (th > h && th > prevth)
{
tiles[idx++] = flag->get_tile_type(x, y, h);
changed = true;
}
else
tiles[idx++] = 0;
}
}
if (!changed)
continue;
uint8_t encoded[65536];
uint32_t encoded_len = 0;
if (!cc::encode_blocks(tiles, idx, encoded, &encoded_len))