mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #770 from heinrich5991/pr_fix_events_uuid
Fix unpacking of net events
This commit is contained in:
commit
ca9cca4c94
|
@ -194,19 +194,20 @@ if gen_network_source:
|
|||
|
||||
lines += ["const char *CNetObjHandler::ms_apObjNames[] = {"]
|
||||
lines += ['\t"invalid",']
|
||||
lines += ['\t"%s",' % o.name for o in network.Objects]
|
||||
lines += ['\t"%s",' % o.name for o in network.Objects if o.ex is None]
|
||||
lines += ['\t""', "};", ""]
|
||||
|
||||
lines += ["int CNetObjHandler::ms_aObjSizes[] = {"]
|
||||
lines += ['\t0,']
|
||||
lines += ['\tsizeof(%s),' % o.struct_name for o in network.Objects]
|
||||
lines += ['\tsizeof(%s),' % o.struct_name for o in network.Objects if o.ex is None]
|
||||
lines += ['\t0', "};", ""]
|
||||
|
||||
|
||||
lines += ['const char *CNetObjHandler::ms_apMsgNames[] = {']
|
||||
lines += ['\t"invalid",']
|
||||
for msg in network.Messages:
|
||||
lines += ['\t"%s",' % msg.name]
|
||||
if msg.ex is None:
|
||||
lines += ['\t"%s",' % msg.name]
|
||||
lines += ['\t""']
|
||||
lines += ['};']
|
||||
lines += ['']
|
||||
|
|
|
@ -359,7 +359,7 @@ int CSnapshotDelta::UnpackDelta(CSnapshot *pFrom, CSnapshot *pTo, void *pSrcData
|
|||
|
||||
Type = *pData++;
|
||||
ID = *pData++;
|
||||
if ((unsigned int)Type < sizeof(m_aItemSizes) && m_aItemSizes[Type])
|
||||
if ((unsigned int)Type < sizeof(m_aItemSizes) / sizeof(m_aItemSizes[0]) && m_aItemSizes[Type])
|
||||
ItemSize = m_aItemSizes[Type];
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue