mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fix float comparison
This commit is contained in:
parent
868b41c8ee
commit
fc1e9f70f9
@ -45,7 +45,7 @@ bool JsonComparer::isEmpty(const JsonNode & value)
|
||||
case JsonNode::JsonType::DATA_BOOL:
|
||||
return !value.Bool();
|
||||
case JsonNode::JsonType::DATA_FLOAT:
|
||||
return value.Float() == 0;
|
||||
return vstd::isAlmostEqual(value.Float(), 0);
|
||||
case JsonNode::JsonType::DATA_INTEGER:
|
||||
return value.Integer() == 0;
|
||||
case JsonNode::JsonType::DATA_STRING:
|
||||
|
Loading…
Reference in New Issue
Block a user