memperf: remove instead of adding, so in cases where there's no suffix we don't allocate any memory for no reason

This commit is contained in:
yairm210 2024-08-25 12:02:01 +03:00
parent 036a2e6e9c
commit a566bb6bc0

View File

@ -517,7 +517,7 @@ class Tile : IsPartOfGameInfoSerialization, Json.Serializable {
val hasResourceWithFilter =
tileResource.name == filter
|| tileResource.hasUnique(filter)
|| tileResource.resourceType.name + " resource" == filter
|| filter.removeSuffix(" resource") == tileResource.resourceType.name
if (!hasResourceWithFilter) return false
// Now that we know that this resource matches the filter - can the observer see that there's a resource here?