networking fixes

This commit is contained in:
2026-03-08 18:57:00 +02:00
parent 1a2a353e03
commit 321a2f31a9
13 changed files with 130 additions and 19 deletions

View File

@@ -12,6 +12,7 @@
#include "netprotocol.h"
static C_BaseEntity *s_pLocalEntity;
CEntitySystem *EntitySystem()
{
@@ -122,6 +123,7 @@ IEntityFactory *CEntitySystem::GetFactoryByClassname( const char *szName )
return NULL;
}
void CEntitySystem::DestroyEntityByIndex( uint32_t uIndex )
{
if ( uIndex >= MAX_EDICTS )
@@ -129,6 +131,8 @@ void CEntitySystem::DestroyEntityByIndex( uint32_t uIndex )
if (m_pEntities[uIndex])
{
V_printf("Deleting: %i\n", uIndex);
if (m_pEntities[uIndex] == s_pLocalEntity)
s_pLocalEntity = 0;
delete m_pEntities[uIndex];
m_pEntities[uIndex] = 0;
}
@@ -174,9 +178,6 @@ searchIndex:
return (char*)pEntity+pCurrentMap->m_pFields[uCurrentIndex].m_uOffset;
}
static C_BaseEntity *s_pLocalEntity;
void CEntitySystem::NetRecvPacket( NetPacket_t *pPacket )
{
PlayerPacket_t *pPlayerPacket = (PlayerPacket_t*)pPacket->pData;