mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Make grenade explode when lifetime is over to allow more fun parts with tunezones
This commit is contained in:
parent
b2f5a1b96e
commit
88c417d6ef
|
@ -186,6 +186,22 @@ void CProjectile::Tick()
|
|||
}
|
||||
if(m_LifeSpan == -1)
|
||||
{
|
||||
if(m_Explosive)
|
||||
{
|
||||
if(m_Owner >= 0)
|
||||
pOwnerChar = GameServer()->GetPlayerChar(m_Owner);
|
||||
|
||||
int64_t TeamMask = -1LL;
|
||||
if (pOwnerChar && pOwnerChar->IsAlive())
|
||||
{
|
||||
TeamMask = pOwnerChar->Teams()->TeamMask(pOwnerChar->Team(), -1, m_Owner);
|
||||
}
|
||||
|
||||
GameServer()->CreateExplosion(ColPos, m_Owner, m_Weapon, m_Owner == -1, (!pOwnerChar ? -1 : pOwnerChar->Team()),
|
||||
(m_Owner != -1)? TeamMask : -1LL);
|
||||
GameServer()->CreateSound(ColPos, m_SoundImpact,
|
||||
(m_Owner != -1)? TeamMask : -1LL);
|
||||
}
|
||||
GameServer()->m_World.DestroyEntity(this);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue