void AAS_SetAASBlockingEntity( vec3_t absmin, vec3_t absmax, qboolean blocking ) {
	int areas[128];
	int numareas, i, w;
	//
	// check for resetting AAS blocking
	if ( VectorCompare( absmin, absmax ) && blocking < 0 ) {
		for ( w = 0; w < MAX_AAS_WORLDS; w++ ) {
			AAS_SetCurrentWorld( w );
			//
			if ( !( *aasworld ).loaded ) {
				continue;
			}
			// now clear blocking status
			for ( i = 1; i < ( *aasworld ).numareas; i++ ) {
				AAS_EnableRoutingArea( i, qtrue );
			}
		}
		//
		return;
	}
	//
	for ( w = 0; w < MAX_AAS_WORLDS; w++ ) {
		AAS_SetCurrentWorld( w );
		//
		if ( !( *aasworld ).loaded ) {
			continue;
		}
		// grab the list of areas
		numareas = AAS_BBoxAreas( absmin, absmax, areas, 128 );
		// now set their blocking status
		for ( i = 0; i < numareas; i++ ) {
			AAS_EnableRoutingArea( areas[i], !blocking );
		}
	}
}
Exemple #2
0
void AAS_SetAASBlockingEntity(vec3_t absmin, vec3_t absmax, int blocking)
{
	int             areas[1024];
	int             numareas, i, w;
	bool        mover, changed = false;

	//
	// check for resetting AAS blocking
	if(VectorCompare(absmin, absmax) && blocking < 0)
	{
		for(w = 0; w < MAX_AAS_WORLDS; w++)
		{
			AAS_SetCurrentWorld(w);
			//
			if(!(*aasworld).loaded)
			{
				continue;
			}
			// now clear blocking status
			for(i = 1; i < (*aasworld).numareas; i++)
			{
				AAS_EnableRoutingArea(i, true);
			}
		}
		//
		return;
	}
	//
	if(blocking & BLOCKINGFLAG_MOVER)
	{
		mover = true;
		blocking &= ~BLOCKINGFLAG_MOVER;
	}
	else
	{
		mover = false;
	}
	//
  areas_again:
	//
	for(w = 0; w < MAX_AAS_WORLDS; w++)
	{
		AAS_SetCurrentWorld(w);
		//
		if(!(*aasworld).loaded)
		{
			continue;
		}
		// grab the list of areas
		numareas = AAS_BBoxAreas(absmin, absmax, areas, 1024);
		// now set their blocking status
		for(i = 0; i < numareas; i++)
		{
			if(mover)
			{
				if(!(aasworld->areasettings[areas[i]].contents & AREACONTENTS_MOVER))
				{
					continue;	// this isn't a mover area, so ignore it
				}
			}
			AAS_EnableRoutingArea(areas[i], (blocking & ~0x1) | !(blocking & 1));
			changed = true;
		}
	}
	//
	if(mover && !changed)
	{							// map must not be compiled with MOVER flags enabled, so redo the old way
		mover = false;
		goto areas_again;
	}
}