forked from teamnwah/openmw-tes3coop
[Client] Ignore invalid object refIds from ObjectPlace packets
This commit is contained in:
parent
4496625154
commit
ce5670e57e
1 changed files with 23 additions and 14 deletions
|
@ -173,8 +173,11 @@ void WorldEvent::placeObjects(MWWorld::CellStore* cellStore)
|
||||||
|
|
||||||
// Only create this object if it doesn't already exist
|
// Only create this object if it doesn't already exist
|
||||||
if (!ptrFound)
|
if (!ptrFound)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
MWWorld::ManualRef ref(world->getStore(), worldObject.refId, 1);
|
MWWorld::ManualRef ref(world->getStore(), worldObject.refId, 1);
|
||||||
|
|
||||||
MWWorld::Ptr newPtr = ref.getPtr();
|
MWWorld::Ptr newPtr = ref.getPtr();
|
||||||
|
|
||||||
if (worldObject.count > 1)
|
if (worldObject.count > 1)
|
||||||
|
@ -194,6 +197,12 @@ void WorldEvent::placeObjects(MWWorld::CellStore* cellStore)
|
||||||
|
|
||||||
if (guid == Main::get().getLocalPlayer()->guid && worldObject.droppedByPlayer)
|
if (guid == Main::get().getLocalPlayer()->guid && worldObject.droppedByPlayer)
|
||||||
world->PCDropped(newPtr);
|
world->PCDropped(newPtr);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (std::exception&)
|
||||||
|
{
|
||||||
|
LOG_APPEND(Log::LOG_INFO, "-- Ignored placement of invalid object");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LOG_APPEND(Log::LOG_VERBOSE, "-- Object already existed!");
|
LOG_APPEND(Log::LOG_VERBOSE, "-- Object already existed!");
|
||||||
|
|
Loading…
Reference in a new issue