Permalink
Browse files

add a floating point fudge factor to the floating complain to silence…

… log spam

Fixes #850
  • Loading branch information...
DolceTriade committed Dec 20, 2015
1 parent cdb4cc8 commit 9c98c92a6aa7be0be721eeea06c827899145cf6b
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/sgame/components/ResourceStorageComponent.cpp
@@ -48,7 +48,7 @@ float ResourceStorageComponent::GetStoredFraction() {
// The stored fraction is equal to the acquired fraction.
float storedFraction = acquiredBuildPoints / level.team[team].acquiredBuildPoints;

if (storedFraction < 0.0f || storedFraction > 1.0f) {
if (storedFraction < 0.0f || storedFraction > 1.0f + 1.0e-5) {
resourceStorageLogger.Warn(
"A resource storage stores an invalid fraction of all build points: %.1f", storedFraction
);

1 comment on commit 9c98c92

@Viech

This comment has been minimized.

Copy link
Member

Viech commented on 9c98c92 Dec 20, 2015

There should be some constant that does this. grep for EPSILON.

Please sign in to comment.