dual objective bug


(Demolama) #1

hey guys… Ive been working on fixing some etmain bugs… Ive run into the riflenade exploit (which I havent fixed yet) as well as the dual objective not returning like it supposed to

gentity_t *Team_ResetFlag(int team)
{
	char *c;
	gentity_t *ent, *rent = NULL;

	switch (team) 
	{
	case TEAM_AXIS:
		c = "team_CTF_redflag";
		break;
	case TEAM_ALLIES:
		c = "team_CTF_blueflag";
		break;
	default:
		return NULL;
	}

	ent = NULL;
	while ((ent = G_Find (ent, FOFS(classname), c)) != NULL)
	{
		if (ent->flags & FL_DROPPED_ITEM)
		{
       			G_FreeEntity(ent);
		}	else {
			rent = ent;
			ent->s.density++;

		// do we need to respawn?
			if( ent->s.density == 1 )
			{
			
			RespawnItem(ent);   
		   
			}
	   
		}
		
	}
	return rent;
}

I can now get the object to return to its original spawns spot however I can not get where it was recovered from to disapear… I tried G_Freeentity(ent) after respawnItem… but that just got rid of the object all together from the map

when an item is dropped you can not pick it up again until its secured… when secured
the old objective can be picked up again and ran to the spot you need to go however because its null it will not do anything

any ideas on how to get rid of the old already recovered objective thats still on the map?


(bani) #2

instead of freeentity, try ent->nextthink = level.time + 50


(Demolama) #3

thanks for the help bani…but Im still getting the same results :frowning: Im obviously not doing something right somewhere :banghead:

etpro team has my respect when it comes to al the bug fixes they have done

/me grumbles fucking buggy ass shit


(Oxygen - o2) #4

im not a coder so i wouldnt know, but i think this might help, from ETpro forums

http://bani.anime.net/banimod/forums/viewtopic.php?t=3787


(Demolama) #5

thats the fix for the riflenades thru the door that bani was so kind to give to the people to use