mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
Try to unfix the grenade bug for the map "Binary"
This commit is contained in:
parent
4576dae6aa
commit
b9cdacbb37
|
@ -29,6 +29,7 @@ CProjectile::CProjectile
|
||||||
m_Type = Type;
|
m_Type = Type;
|
||||||
m_Pos = Pos;
|
m_Pos = Pos;
|
||||||
m_Direction = Dir;
|
m_Direction = Dir;
|
||||||
|
m_InitialLifeSpan = Span;
|
||||||
m_LifeSpan = Span;
|
m_LifeSpan = Span;
|
||||||
m_Owner = Owner;
|
m_Owner = Owner;
|
||||||
m_Force = Force;
|
m_Force = Force;
|
||||||
|
@ -153,10 +154,18 @@ void CProjectile::Tick()
|
||||||
{
|
{
|
||||||
if(m_Explosive/*??*/ && (!pTargetChr || (pTargetChr && (!m_Freeze || (m_Weapon == WEAPON_SHOTGUN && Collide)))))
|
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()),
|
int Number = 1;
|
||||||
(m_Owner != -1)? TeamMask : -1LL);
|
if(GameServer()->EmulateBug(BUG_GRENADE_DOUBLEEXPLOSION) && m_LifeSpan == -1 && m_InitialLifeSpan == 0)
|
||||||
GameServer()->CreateSound(ColPos, m_SoundImpact,
|
{
|
||||||
(m_Owner != -1)? TeamMask : -1LL);
|
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))
|
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();
|
pTargetChr->Freeze();
|
||||||
|
@ -181,11 +190,13 @@ void CProjectile::Tick()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
if (!m_Freeze)
|
if (!m_Freeze)
|
||||||
{
|
{
|
||||||
GameServer()->m_World.DestroyEntity(this);
|
GameServer()->m_World.DestroyEntity(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(m_LifeSpan == -1)
|
if(m_LifeSpan == -1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,6 +33,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
vec2 m_Direction;
|
vec2 m_Direction;
|
||||||
|
int m_InitialLifeSpan;
|
||||||
int m_LifeSpan;
|
int m_LifeSpan;
|
||||||
int m_Owner;
|
int m_Owner;
|
||||||
int m_Type;
|
int m_Type;
|
||||||
|
|
Loading…
Reference in a new issue