summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-10-05 14:09:42 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-12-18 22:03:40 +0100
commit090d8305e4e3c3ee085a897b72f2b4708e183eb8 (patch)
treee703cc7fcb7f16c85f16b094d5df0bd0a8d698e8 /src/WorldStorage
parentHorsies: don't always broadcast metadata (diff)
downloadcuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.gz
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.bz2
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.lz
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.xz
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.zst
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.zip
Diffstat (limited to '')
-rw-r--r--src/WorldStorage/StatSerializer.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/WorldStorage/StatSerializer.cpp b/src/WorldStorage/StatSerializer.cpp
index d5543ca79..4721d7022 100644
--- a/src/WorldStorage/StatSerializer.cpp
+++ b/src/WorldStorage/StatSerializer.cpp
@@ -151,13 +151,7 @@ namespace StatSerializer
if ((FindResult != LegacyMapping.end()) && Entry->isInt())
{
- auto Value = Entry->asInt();
- if (Value < 0)
- {
- FLOGWARNING("Invalid stat value: {0} = {1}", Key, Value);
- continue;
- }
- Manager.SetValue(FindResult->second, ToUnsigned(Value));
+ Manager.SetValue(FindResult->second, Entry->asUInt());
}
}
}
@@ -181,13 +175,7 @@ namespace StatSerializer
const auto & StatName = StatInfo.second;
try
{
- auto Value = it->asInt();
- if (Value < 0)
- {
- FLOGWARNING("Invalid statistic value: {0} = {1}", Key, Value);
- continue;
- }
- Manager.SetValue(NamespaceSerializer::ToCustomStatistic(StatName), ToUnsigned(Value));
+ Manager.SetValue(NamespaceSerializer::ToCustomStatistic(StatName), it->asUInt());
}
catch (const std::out_of_range &)
{