[General] Add comments to false-positive PVS messages

experimental-mono
Koncord 6 years ago
parent 5282541d3a
commit 4225cbae02

@ -31,7 +31,7 @@ bool ObjectProcessor::Process(RakNet::Packet &packet, BaseObjectList &objectList
if (!processor.second->avoidReading) if (!processor.second->avoidReading)
myPacket->Read(); myPacket->Read();
if (objectList.isValid) // -V547 if (objectList.isValid) // -V547 (PVS Studio false-positive warning)
processor.second->Do(*myPacket, *player, objectList); processor.second->Do(*myPacket, *player, objectList);
else else
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str());

@ -28,7 +28,7 @@ bool WorldstateProcessor::Process(RakNet::Packet &packet, BaseWorldstate &worlds
if (!processor.second->avoidReading) if (!processor.second->avoidReading)
myPacket->Read(); myPacket->Read();
if (worldstate.isValid) // -V547 if (worldstate.isValid) // -V547 (PVS Studio false-positive warning)
processor.second->Do(*myPacket, *player, worldstate); processor.second->Do(*myPacket, *player, worldstate);
else else
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str());

@ -146,14 +146,11 @@ mwmp::Target MechanicsHelper::getTarget(const MWWorld::Ptr& ptr)
{ {
MWWorld::CellRef *ptrRef = &ptr.getCellRef(); MWWorld::CellRef *ptrRef = &ptr.getCellRef();
if (ptrRef) target.isPlayer = false;
{ target.refId = ptrRef->getRefId();
target.isPlayer = false; target.refNum = ptrRef->getRefNum().mIndex;
target.refId = ptrRef->getRefId(); target.mpNum = ptrRef->getMpNum();
target.refNum = ptrRef->getRefNum().mIndex; target.name = ptr.getClass().getName(ptr);
target.mpNum = ptrRef->getMpNum();
target.name = ptr.getClass().getName(ptr);
}
} }
} }

@ -453,8 +453,6 @@ void RecordHelper::overrideArmorRecord(const mwmp::ArmorRecord& record)
ESM::Armor finalData = *baseData; ESM::Armor finalData = *baseData;
finalData.mId = recordData.mId; finalData.mId = recordData.mId;
finalData.mParts.mParts.at(0);
if (record.baseOverrides.hasName) if (record.baseOverrides.hasName)
finalData.mName = recordData.mName; finalData.mName = recordData.mName;

@ -36,7 +36,7 @@ bool ActorProcessor::Process(RakNet::Packet &packet, ActorList &actorList)
myPacket->Read(); myPacket->Read();
} }
if (actorList.isValid) if (actorList.isValid) // -V547 (PVS Studio false-positive warning)
processor.second->Do(*myPacket, actorList); processor.second->Do(*myPacket, actorList);
else else
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str());

@ -31,7 +31,7 @@ bool ObjectProcessor::Process(RakNet::Packet &packet, ObjectList &objectList)
if (!request && !processor.second->avoidReading) if (!request && !processor.second->avoidReading)
myPacket->Read(); myPacket->Read();
if (objectList.isValid) if (objectList.isValid) // -V547 (PVS Studio false-positive warning)
processor.second->Do(*myPacket, objectList); processor.second->Do(*myPacket, objectList);
else else
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str());

@ -31,7 +31,7 @@ bool WorldstateProcessor::Process(RakNet::Packet &packet, Worldstate &worldstate
if (!request && !processor.second->avoidReading) if (!request && !processor.second->avoidReading)
myPacket->Read(); myPacket->Read();
if (worldstate.isValid) if (worldstate.isValid) // -V547 (PVS Studio false-positive warning)
processor.second->Do(*myPacket, worldstate); processor.second->Do(*myPacket, worldstate);
else else
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str());

@ -11,7 +11,7 @@ namespace mwmp
ProcessorPlayerCellState() ProcessorPlayerCellState()
{ {
BPP_INIT(ID_PLAYER_CELL_STATE) BPP_INIT(ID_PLAYER_CELL_STATE)
avoidReading = true; avoidReading = true; // -V519 (PVS Studio false-positive warning)
} }
virtual void Do(PlayerPacket &packet, BasePlayer *player) virtual void Do(PlayerPacket &packet, BasePlayer *player)

@ -16,7 +16,7 @@ namespace mwmp
ProcessorPlayerDeath() ProcessorPlayerDeath()
{ {
BPP_INIT(ID_PLAYER_DEATH) BPP_INIT(ID_PLAYER_DEATH)
avoidReading = true; avoidReading = true; // -V519 (PVS Studio false-positive warning)
} }
virtual void Do(PlayerPacket &packet, BasePlayer *player) virtual void Do(PlayerPacket &packet, BasePlayer *player)

@ -18,7 +18,7 @@ namespace mwmp
ProcessorUserDisconnected() ProcessorUserDisconnected()
{ {
BPP_INIT(ID_USER_DISCONNECTED) BPP_INIT(ID_USER_DISCONNECTED)
avoidReading = true; avoidReading = true; // -V519 (PVS Studio false-positive warning)
} }
virtual void Do(PlayerPacket &packet, BasePlayer *player) virtual void Do(PlayerPacket &packet, BasePlayer *player)

Loading…
Cancel
Save