forked from townforge/townforge
game: fix approving a build with unused placeholder entries
This commit is contained in:
parent
74f6d85b27
commit
47f157c553
@ -7386,6 +7386,24 @@ void CryptoCityUrho3D::HandleApproveBuild(StringHash eventType, VariantMap& even
|
||||
continue;
|
||||
if (flag->palette[i] == cc::BLOCK_VARIANT_PLACEHOLDER)
|
||||
{
|
||||
// if there are uses of this entry, zero it and continue
|
||||
bool found = false;
|
||||
for (const auto &t: flag_tile_data->tiles)
|
||||
{
|
||||
for (uint8_t e: t)
|
||||
{
|
||||
if (e == i)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
flag->palette[i] = 0;
|
||||
continue;
|
||||
}
|
||||
new MessageBox(context_, "The palette still contains placeholder materials");
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user