Try to unfix the grenade bug for the map "Binary"

This commit is contained in:
heinrich5991 2018-03-24 14:01:01 +01:00
parent 4576dae6aa
commit b9cdacbb37
2 changed files with 16 additions and 4 deletions

View file

@ -29,6 +29,7 @@ CProjectile::CProjectile
m_Type = Type;
m_Pos = Pos;
m_Direction = Dir;
m_InitialLifeSpan = Span;
m_LifeSpan = Span;
m_Owner = Owner;
m_Force = Force;
@ -153,10 +154,18 @@ void CProjectile::Tick()
{
if(m_Explosive/*??*/ && (!pTargetChr || (pTargetChr && (!m_Freeze || (m_Weapon == WEAPON_SHOTGUN && Collide)))))
{
GameServer()->CreateExplosion(ColPos, m_Owner, m_Weapon, m_Owner == -1, (!pTargetChr ? -1 : pTargetChr->Team()),
(m_Owner != -1)? TeamMask : -1LL);
GameServer()->CreateSound(ColPos, m_SoundImpact,
(m_Owner != -1)? TeamMask : -1LL);
int Number = 1;
if(GameServer()->EmulateBug(BUG_GRENADE_DOUBLEEXPLOSION) && m_LifeSpan == -1 && m_InitialLifeSpan == 0)
{
Number = 2;
}
for(int i = 0; i < Number; i++)
{
GameServer()->CreateExplosion(ColPos, m_Owner, m_Weapon, m_Owner == -1, (!pTargetChr ? -1 : pTargetChr->Team()),
(m_Owner != -1)? TeamMask : -1LL);
GameServer()->CreateSound(ColPos, m_SoundImpact,
(m_Owner != -1)? TeamMask : -1LL);
}
}
else if(pTargetChr && m_Freeze && ((m_Layer == LAYER_SWITCH && GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[pTargetChr->Team()]) || m_Layer != LAYER_SWITCH))
pTargetChr->Freeze();
@ -181,11 +190,13 @@ void CProjectile::Tick()
return;
}
else
{
if (!m_Freeze)
{
GameServer()->m_World.DestroyEntity(this);
return;
}
}
}
if(m_LifeSpan == -1)
{

View file

@ -33,6 +33,7 @@ public:
private:
vec2 m_Direction;
int m_InitialLifeSpan;
int m_LifeSpan;
int m_Owner;
int m_Type;