mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Fixed wrong VSS source allocation
This commit is contained in:
parent
76178064a0
commit
a1cd6f2746
1 changed files with 13 additions and 8 deletions
|
@ -145,18 +145,23 @@ void VSS_AddRepulsion(cvssource_t* pA, cvssource_t* pB)
|
|||
|
||||
cvssource_t* ClientGameCommandManager::AllocateVSSSource()
|
||||
{
|
||||
m_free_vsssources = m_free_vsssources;
|
||||
cvssource_t* pNew;
|
||||
|
||||
if (!m_free_vsssources) {
|
||||
FreeVSSSource(m_active_vsssources.prev);
|
||||
}
|
||||
|
||||
pNew = m_free_vsssources;
|
||||
m_free_vsssources = m_free_vsssources->next;
|
||||
memset(m_free_vsssources, 0, sizeof(cvssource_t));
|
||||
memset(pNew, 0, sizeof(cvssource_t));
|
||||
|
||||
m_free_vsssources->next = m_active_vsssources.next;
|
||||
m_free_vsssources->prev = &m_active_vsssources;
|
||||
pNew->next = m_active_vsssources.next;
|
||||
pNew->prev = &m_active_vsssources;
|
||||
|
||||
m_active_vsssources.next->prev = m_free_vsssources;
|
||||
m_active_vsssources.next = m_free_vsssources;
|
||||
m_active_vsssources.next->prev = pNew;
|
||||
m_active_vsssources.next = pNew;
|
||||
|
||||
return m_free_vsssources;
|
||||
return pNew;
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::FreeVSSSource(cvssource_t* p)
|
||||
|
@ -201,7 +206,7 @@ void ClientGameCommandManager::ResetVSSSources()
|
|||
}
|
||||
|
||||
m_vsssources = (cvssource_t*)cgi.Malloc(sizeof(cvssource_t) * m_iAllocatedvsssources);
|
||||
memset(m_vsssources, 0, sizeof(sizeof(cvssource_t) * m_iAllocatedvsssources));
|
||||
memset(m_vsssources, 0, sizeof(cvssource_t) * m_iAllocatedvsssources);
|
||||
|
||||
m_active_vsssources.next = &m_active_vsssources;
|
||||
m_active_vsssources.prev = &m_active_vsssources;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue