Fix resource area calculation

This commit is contained in:
Gustas
2025-03-28 12:18:42 +02:00
parent 7fc415de19
commit d9c5821329
2 changed files with 27 additions and 21 deletions

View File

@@ -160,7 +160,9 @@ namespace OpenRA.Mods.Common.Traits
++adjacent;
}
// Adjacent includes the current cell, so is always >= 1
// We need to have at least one resource in the cell.
// HACK: we should not be lerping to 9, as maximum adjacent resources is 8.
// HACK: it's too disruptive to fix.
var density = Math.Max(int2.Lerp(0, resourceInfo.MaxDensity, adjacent, 9), 1);
Content[cell] = new ResourceLayerContents(resource.Type, density);
}