fix assertions around dropped (because ancient) messages

I'm seeing these only when opening games several years old, and they
shouldn't matter on release builds. Still....
This commit is contained in:
Eric House 2023-04-07 19:53:51 -07:00
parent f8c5a4ea58
commit f9d3f9fd4e

View file

@ -939,7 +939,9 @@ comms_makeFromStream( MPFORMAL XWEnv xwe, XWStreamCtxt* stream,
msg->checksum = dutil_md5sum( comms->dutil, xwe, msg->smp.buf, len );
#endif
XP_ASSERT( NULL == msg->smp.next );
(void)addToQueue( comms, xwe, msg, XP_FALSE );
if ( !addToQueue( comms, xwe, msg, XP_FALSE ) ) {
--queueLen; /* was dropped */
}
}
XP_ASSERT( queueLen == comms->queueLen );
@ -1759,7 +1761,6 @@ addToQueue( CommsCtxt* comms, XWEnv xwe, MsgQueueElem* newElem, XP_Bool notify )
MsgQueueElem** head;
AddressRecord* rec = getRecordFor( comms, newElem->channelNo );
XP_ASSERT( !!rec ); /* I've seen this once on an old game */
if ( !rec ) {
freeElem( MPPARM(comms->mpool) newElem );
asAdded = NULL;