Fix: No ninja in solo

This commit is contained in:
def 2013-08-04 22:50:14 +02:00
parent 05d2cb8383
commit 02ac497531

View file

@ -165,11 +165,23 @@ void CCharacter::HandleNinja()
vec2 Center = OldPos + Dir * 0.5f;
int Num = GameServer()->m_World.FindEntities(Center, Radius, (CEntity**)aEnts, MAX_CLIENTS, CGameWorld::ENTTYPE_CHARACTER);
// check that we're not in solo part
if (Teams()->m_Core.GetSolo(m_pPlayer->GetCID()))
return;
for (int i = 0; i < Num; ++i)
{
if (aEnts[i] == this)
continue;
// Don't hit players in other teams
if (Team() != aEnts[i]->Team())
continue;
// Don't hit players in solo parts
if (Teams()->m_Core.GetSolo(aEnts[i]->m_pPlayer->GetCID()))
return;
// make sure we haven't Hit this object before
bool bAlreadyHit = false;
for (int j = 0; j < m_NumObjectsHit; j++)
@ -184,10 +196,6 @@ void CCharacter::HandleNinja()
if (distance(aEnts[i]->m_Pos, m_Pos) > (m_ProximityRadius * 2.0f))
continue;
// Don't hit players in other teams
if (Team() != aEnts[i]->Team())
continue;
// Hit a player, give him damage and stuffs...
GameServer()->CreateSound(aEnts[i]->m_Pos, SOUND_NINJA_HIT, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
// set his velocity to fast upward (for now)