Skip to content

Commit

Permalink
Add logging for issue #1077
Browse files Browse the repository at this point in the history
  • Loading branch information
botder committed Aug 28, 2019
1 parent f2407e7 commit 0c3975f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Client/mods/deathmatch/logic/CPacketHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4832,10 +4832,28 @@ void CPacketHandler::Packet_ResourceStart(NetBitStreamInterface& bitStream)
// Get the resource dynamic entity
CClientEntity* pResourceDynamicEntity = CElementIDs::GetElement(ResourceDynamicEntityID);

if (!pResourceEntity || !pResourceDynamicEntity)
{
// Crash investigation code for forced crash in CResource::Load() at `assert(0);` - m_pResourceEntity is null
WriteDebugEvent(SString("Packet_ResourceStart() [1] - pResourceEntity: %p (ID: %u), pResourceDynamicEntity: %p (ID: %u)", pResourceEntity,
ResourceEntityID.Value(), pResourceDynamicEntity, ResourceDynamicEntityID.Value()));
assert(false);
return;
}

CResource* pResource = g_pClientGame->m_pResourceManager->Add(usResourceID, szResourceName, pResourceEntity, pResourceDynamicEntity, strMinServerReq,
strMinClientReq, bEnableOOP);
if (pResource)
{
if (!pResource->GetResourceEntity())
{
// Crash investigation code for forced crash in CResource::Load() at `assert(0);` - m_pResourceEntity is null
WriteDebugEvent(SString("Packet_ResourceStart() [2] - pResourceEntity: %p (ID: %u), pResourceDynamicEntity: %p (ID: %u)", pResourceEntity,
ResourceEntityID.Value(), pResourceDynamicEntity, ResourceDynamicEntityID.Value()));
assert(false);
return;
}

pResource->SetRemainingNoClientCacheScripts(usNoClientCacheScriptCount);
pResource->SetDownloadPriorityGroup(iDownloadPriorityGroup);

Expand Down Expand Up @@ -4958,7 +4976,18 @@ void CPacketHandler::Packet_ResourceStart(NetBitStreamInterface& bitStream)
{
// Load the resource now
if (pResource->CanBeLoaded())
{
if (!pResource->GetResourceEntity())
{
// Crash investigation code for forced crash in CResource::Load() at `assert(0);` - m_pResourceEntity is null
WriteDebugEvent(SString("Packet_ResourceStart() [3] - pResourceEntity: %p (ID: %u), pResourceDynamicEntity: %p (ID: %u)", pResourceEntity,
ResourceEntityID.Value(), pResourceDynamicEntity, ResourceDynamicEntityID.Value()));
assert(false);
return;
}

pResource->Load();
}
}
}

Expand Down

1 comment on commit 0c3975f

@botder
Copy link
Member Author

@botder botder commented on 0c3975f Sep 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed and fixed in commit 4d64de6

Please sign in to comment.