This commit is contained in:
def 2018-04-04 20:03:05 +02:00
parent 8d98bd4e9f
commit 30679364f5

View file

@ -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) void CGameContext::CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamage, int ActivatedTeam, int64_t Mask)
{ {
// create the event // create the event
@ -189,17 +188,18 @@ void CGameContext::CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamag
float Dmg = Strength * l; float Dmg = Strength * l;
if(!(int)Dmg) continue; 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; // Explode at most once per team
if(Owner == -1 && ActivatedTeam != -1 && apEnts[i]->IsAlive() && apEnts[i]->Team() != ActivatedTeam) continue; 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 apEnts[i]->TakeDamage(ForceDir*Dmg*2, (int)Dmg, Owner, Weapon);
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);
} }
//} //}
} }