queue not removing objects with pop [solved]

Started by
1 comment, last by jchmack 17 years, 1 month ago
i have a queue of pointers to projectile objects: queue<Projectile*> InactiveProjectiles; and i want to remove an object after it has been reactivated. this works the way i would like:


projectile *temp;

if(!InactiveProjectiles.empty())
{
        
	temp = InactiveProjectiles.front();
	//temp->Reactivate(mScene,GunNode,Target,Target2);
	InactiveProjectiles.pop();
}




but the instant i uncomment that reactivate line the pop doesnt seem to work (the queue doesn't get any shorter)... for now all reactivate() is:

void Projectile::Reactivate(scene *_mScene,SceneNode* GunNode,Vector3 Target,Vector3 Target2)
{
	Active=true;
}




what is going on....... why is it that if i change one thing in this object i can't pop it from my queue? [Edited by - jchmack on March 11, 2007 4:45:46 AM]
Advertisement
even if i change the order of things:

if(!InactiveProjectiles.empty()){	temp = InactiveProjectiles.front();	InactiveProjectiles.pop();	temp->Reactivate(mScene,GunNode,Target,Target2);		}


it doesn't pop even before i call reactivate... can i not pop an object if i change its data or something? and even if i couldn't shouldnt popping it before i change its data fix the problem? Im not even changing the pointer itself just the stuff thats being pointed too. Sigh im really confused by this.
bah was being dumb it was changing active back to false and re adding it to the queue because it was over a certain age.

This topic is closed to new replies.

Advertisement