mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Fix float comparisons
Replace this "==" with a more tolerant comparison operation. Floating point numbers should not be tested for equality cpp:S1244
This commit is contained in:
@@ -102,7 +102,7 @@ struct DLL_LINKAGE CGPathNode
|
||||
STRONG_INLINE
|
||||
void setCost(float value)
|
||||
{
|
||||
if(value == cost)
|
||||
if(vstd::isAlmostEqual(value, cost))
|
||||
return;
|
||||
|
||||
bool getUpNode = value < cost;
|
||||
|
||||
Reference in New Issue
Block a user