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;
@ -152,12 +153,20 @@ void CProjectile::Tick()
if( ((pTargetChr && (pOwnerChar ? !(pOwnerChar->m_Hit&CCharacter::DISABLE_HIT_GRENADE) : g_Config.m_SvHit || m_Owner == -1 || pTargetChr == pOwnerChar)) || Collide || GameLayerClipped(CurPos)) && !IsWeaponCollide)
{
if(m_Explosive/*??*/ && (!pTargetChr || (pTargetChr && (!m_Freeze || (m_Weapon == WEAPON_SHOTGUN && Collide)))))
{
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();
if(Collide && m_Bouncing != 0)
@ -181,12 +190,14 @@ void CProjectile::Tick()
return;
}
else
{
if (!m_Freeze)
{
GameServer()->m_World.DestroyEntity(this);
return;
}
}
}
if(m_LifeSpan == -1)
{
if(m_Explosive)

View file

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