1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Fix float comparison

This commit is contained in:
Alexander Wilms 2024-02-18 23:16:11 +01:00
parent 868b41c8ee
commit fc1e9f70f9

View File

@ -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: