mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix explosion issue. Dont pull, not tested. Can pull if test both commits=)
This commit is contained in:
parent
748065dbcf
commit
cd59d111a8
|
@ -36,7 +36,7 @@ bool CPlasma::HitCharacter()
|
|||
if(Hit->Team() != m_ResponsibleTeam) return false;
|
||||
m_Freeze ? Hit->Freeze(Server()->TickSpeed()*3) : Hit->UnFreeze();
|
||||
if(m_Explosive)
|
||||
GameServer()->CreateExplosion(m_Pos, -1, WEAPON_GRENADE, true, Hit->Teams()->TeamMask(m_ResponsibleTeam));
|
||||
GameServer()->CreateExplosion(m_Pos, -1, WEAPON_GRENADE, true, m_ResponsibleTeam, Hit->Teams()->TeamMask(m_ResponsibleTeam));
|
||||
GameServer()->m_World.DestroyEntity(this);
|
||||
return true;
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ void CPlasma::Tick()
|
|||
if(Res)
|
||||
{
|
||||
if(m_Explosive)
|
||||
GameServer()->CreateExplosion(m_Pos, -1, WEAPON_GRENADE, true);
|
||||
GameServer()->CreateExplosion(m_Pos, -1, WEAPON_GRENADE, true, m_ResponsibleTeam, -1);//TODO: Fix mask
|
||||
Reset();
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ void CProjectile::Tick()
|
|||
{
|
||||
if(m_Explosive/*??*/ && (!TargetChr || (TargetChr && !m_Freeze)))
|
||||
{
|
||||
GameServer()->CreateExplosion(ColPos, m_Owner, m_Weapon, m_Owner == -1,
|
||||
GameServer()->CreateExplosion(ColPos, m_Owner, m_Weapon, m_Owner == -1, TargetChr->Team(),
|
||||
(m_Owner != -1)? TeamMask : -1);
|
||||
GameServer()->CreateSound(ColPos, m_SoundImpact,
|
||||
(m_Owner != -1)? TeamMask : -1);
|
||||
|
|
|
@ -120,7 +120,7 @@ void CGameContext::CreateHammerHit(vec2 P, int Mask)
|
|||
}
|
||||
|
||||
|
||||
void CGameContext::CreateExplosion(vec2 P, int Owner, int Weapon, bool NoDamage, int Mask)
|
||||
void CGameContext::CreateExplosion(vec2 P, int Owner, int Weapon, bool NoDamage, int ActivatedTeam,int Mask)
|
||||
{
|
||||
// create the event
|
||||
NETEVENT_EXPLOSION *ev = (NETEVENT_EXPLOSION *)m_Events.Create(NETEVENTTYPE_EXPLOSION, sizeof(NETEVENT_EXPLOSION), Mask);
|
||||
|
@ -150,6 +150,7 @@ void CGameContext::CreateExplosion(vec2 P, int Owner, int Weapon, bool NoDamage,
|
|||
if((g_Config.m_SvHit||NoDamage) || Owner == apEnts[i]->m_pPlayer->GetCID())
|
||||
{
|
||||
if(Owner != -1 && apEnts[i]->m_Alive && !apEnts[i]->CanCollide(Owner)) continue;
|
||||
if(Owner == -1 && apEnts[i]->m_Alive && apEnts[i]->Team() != ActivatedTeam) continue;
|
||||
apEnts[i]->TakeDamage(ForceDir*Dmg*2, (int)Dmg, Owner, Weapon);
|
||||
if(!g_Config.m_SvHit||NoDamage) break;
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ public:
|
|||
|
||||
// helper functions
|
||||
void CreateDamageInd(vec2 Pos, float AngleMod, int Amount, int Mask=-1);
|
||||
void CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamage, int Mask=-1);
|
||||
void CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamage, int ActivatedTeam, int Mask);
|
||||
void CreateSmoke(vec2 Pos, int Mask=-1);
|
||||
void CreateHammerHit(vec2 Pos, int Mask=-1);
|
||||
void CreatePlayerSpawn(vec2 Pos, int Mask=-1);
|
||||
|
|
Loading…
Reference in a new issue