Only delete object from ID_WORLD_OBJECT_DELETE if it actually exists

coverity_scan^2
David Cernat 8 years ago
parent 3c49157ed7
commit 2e57e25675

@ -656,11 +656,14 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
MWWorld::Ptr ptrFound = ptrCellStore->searchByRefNum(event->cellRef.mRefNum);
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Found %s, %i",
ptrFound.getCellRef().getRefId().c_str(),
ptrFound.getCellRef().getRefNum());
if (ptrFound)
{
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Found %s, %i",
ptrFound.getCellRef().getRefId().c_str(),
ptrFound.getCellRef().getRefNum());
MWBase::Environment::get().getWorld()->deleteObject(ptrFound);
MWBase::Environment::get().getWorld()->deleteObject(ptrFound);
}
break;
}

Loading…
Cancel
Save