sorry i seem to of pasted the wrong thing
if(entities.at(i)->isTarget() == false)
{
if(entities.at(i)->GetTeam() != entities.at(c)->GetTeam())
}
if(beDistance(entities.at(i)->GetX(),entities.at(i)->GetY(),entities.at(c)->GetX(),entities.at(c)->GetY()) < 500)
{
entities.at(i)->setTarget(c,false);
projectile projT;
projT.Init(20,
entities.at(i)->GetX(),
entities.at(i)->GetY(),
beFreeSpriteNumber(),
entities.at(i)->GetTeam(),
entities.at(c)->GetX(),
entities.at(c)->GetY(),
0,0,1.0f,GetTickCount()+10000);
projectiles.push_back(projT);
testI++;
entities.at(i)->setTarget(false);
}
}
}
that is where its created
for(int i = 0;i<projectiles.size();i++)
{
if(doLogic == 1)
{
if(beDistance(projectiles.at(i).GetX(),projectiles.at(i).GetY(),projectiles.at(i).GetDX(),projectiles.at(i).GetDY()) < 100)
{
//entities.at(i)->setActive(false);
}
}
projectiles.at(i).Update();
projectiles.at(i).Draw();
txt->DrawTextA(projectiles.at(i).x,projectiles.at(i).y,"p",255,0,0,255,1,true,true);
}