I improved CalculateComfortLevel again, now it only takes ~900 ticks (0,09 ms) to calucate it. Only pieces that can impact comfort (piece.comfort != 0) are stored and the range is calculated with square distance, so no heavy computing here.
This makes your GetAllPiecesInRadius patch currently unused.
I improved
CalculateComfortLevel
again, now it only takes ~900 ticks (0,09 ms) to calucate it. Only pieces that can impact comfort (piece.comfort != 0
) are stored and the range is calculated with square distance, so no heavy computing here. This makes yourGetAllPiecesInRadius
patch currently unused.