Client: Don't erroneously log some errors

This commit is contained in:
Nick Renieris 2022-06-25 03:55:34 +03:00
parent 90f09a8340
commit 71b4237d84

View file

@ -783,19 +783,19 @@ void Client::updatePlayerInfo(PlayerInf *packet) {
if (packet->actName != PlayerAnims::Type::Unknown) { if (packet->actName != PlayerAnims::Type::Unknown) {
strcpy(curInfo->curAnimStr, PlayerAnims::FindStr(packet->actName)); strcpy(curInfo->curAnimStr, PlayerAnims::FindStr(packet->actName));
if (curInfo->curAnimStr[0] == '\0')
Logger::log("[ERROR] %s: actName was out of bounds: %d\n", __func__, packet->actName);
} else { } else {
strcpy(curInfo->curAnimStr, "Wait"); strcpy(curInfo->curAnimStr, "Wait");
} }
if (strlen(curInfo->curAnimStr) == 0)
Logger::log("[ERROR] %s: actName was out of bounds: %d", __func__, packet->actName);
if(packet->subActName != PlayerAnims::Type::Unknown) { if(packet->subActName != PlayerAnims::Type::Unknown) {
strcpy(curInfo->curSubAnimStr, PlayerAnims::FindStr(packet->subActName)); strcpy(curInfo->curSubAnimStr, PlayerAnims::FindStr(packet->subActName));
if (curInfo->curSubAnimStr[0] == '\0')
Logger::log("[ERROR] %s: subActName was out of bounds: %d\n", __func__, packet->subActName);
} else { } else {
strcpy(curInfo->curSubAnimStr, ""); strcpy(curInfo->curSubAnimStr, "");
} }
if (strlen(curInfo->curSubAnimStr) == 0)
Logger::log("[ERROR] %s: subActName was out of bounds: %d", __func__, packet->subActName);
curInfo->curAnim = packet->actName; curInfo->curAnim = packet->actName;
curInfo->curSubAnim = packet->subActName; curInfo->curSubAnim = packet->subActName;