The struct and th list is declared like this.
Code: Select all
struct unitTarget
{
uint16 unitid;
uint16 positionX;
uint16 positionY;
uint16 model;
uint8 animation;
};
list<unitTarget> targets;
Code: Select all
unitTarget myTarget;
myTarget.unitid = unitid;
if(positionx != NULL) myTarget.positionX = positionx;
if(positiony != NULL) myTarget.positionY = positiony;
if(model != NULL) myTarget.model = model;
if(animation != NULL) myTarget.animation = NULL;
targets.push_back(myTarget);
list<unitTarget>::iterator it;
for(it=targets.begin(); it != targets.end(); it++)
{
bool isDead = false;
if((*it).animation == 45 || (*it).animation == 21) isDead = true;
printf("ID: %i, X: %i, Y: %i, Mod: %i, Anim: %i\r", (*it).unitid, (*it).positionX, (*it).positionY, (*it).model, (*it).animation);
//targets.remove_if(isDead);
}