more conversions to weak pointers

This commit is contained in:
Simon Jarrett 2018-06-21 23:32:21 +01:00
parent b08ab94319
commit e91df41c8e
21 changed files with 1201 additions and 747 deletions

View file

@ -41,11 +41,11 @@ CSpellProjectile::~CSpellProjectile()
void CSpellProjectile::Tick()
{
if (!m_bDestroyMe)
if (!ShouldDestroy())
{
if (!InValidCell() || (m_fDestroyTime <= Timer::cur_time))
{
MarkForDestroy();
g_pWorld->RemoveEntity(GetPointer<CWeenieObject>());
}
// not destroyed yet and distance/time exceeded
else if (m_fDestroyTime > Timer::cur_time + 10 && (m_Position.distance(m_CachedSpellCastData.initial_cast_position) > m_CachedSpellCastData.max_range || (m_fSpawnTime + MAX_SPELL_PROJECTILE_LIFETIME - 1) <= Timer::cur_time))