From 30679364f5fa7fbae12acf8be9025e985cd77c83 Mon Sep 17 00:00:00 2001 From: def Date: Wed, 4 Apr 2018 20:03:05 +0200 Subject: [PATCH] Fix --- src/game/server/gamecontext.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 7dadc1840..63ad18eae 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -153,7 +153,6 @@ void CGameContext::CreateHammerHit(vec2 Pos, int64_t Mask) } } - void CGameContext::CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamage, int ActivatedTeam, int64_t Mask) { // create the event @@ -189,17 +188,18 @@ void CGameContext::CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamag float Dmg = Strength * l; if(!(int)Dmg) continue; - if((GetPlayerChar(Owner) ? GetPlayerChar(Owner)->m_Hit&CCharacter::DISABLE_HIT_GRENADE : !g_Config.m_SvHit && !NoDamage) && Owner != apEnts[i]->GetPlayer()->GetCID()) continue; + if((GetPlayerChar(Owner) ? !(GetPlayerChar(Owner)->m_Hit&CCharacter::DISABLE_HIT_GRENADE) : g_Config.m_SvHit || NoDamage) || Owner == apEnts[i]->GetPlayer()->GetCID()) + { + if(Owner != -1 && apEnts[i]->IsAlive() && !apEnts[i]->CanCollide(Owner)) continue; + if(Owner == -1 && ActivatedTeam != -1 && apEnts[i]->IsAlive() && apEnts[i]->Team() != ActivatedTeam) continue; - if(Owner != -1 && apEnts[i]->IsAlive() && !apEnts[i]->CanCollide(Owner)) continue; - if(Owner == -1 && ActivatedTeam != -1 && apEnts[i]->IsAlive() && apEnts[i]->Team() != ActivatedTeam) continue; + // Explode at most once per team + int PlayerTeam = ((CGameControllerDDRace*)m_pController)->m_Teams.m_Core.Team(apEnts[i]->GetPlayer()->GetCID()); + if(!CmaskIsSet(Mask, PlayerTeam)) continue; + Mask = CmaskUnset(Mask, PlayerTeam); - // Explode at most once per team - int PlayerTeam = ((CGameControllerDDRace*)m_pController)->m_Teams.m_Core.Team(apEnts[i]->GetPlayer()->GetCID()); - if(!CmaskIsSet(Mask, PlayerTeam)) continue; - Mask = CmaskUnset(Mask, PlayerTeam); - - apEnts[i]->TakeDamage(ForceDir*Dmg*2, (int)Dmg, Owner, Weapon); + apEnts[i]->TakeDamage(ForceDir*Dmg*2, (int)Dmg, Owner, Weapon); + } } //} }