p_maputl.c
/*
===================
=
= P_UnsetThingPosition 
=
= Unlinks a thing from block map and sectors
=
===================
*/
P_UnsetThingPosition
Unlinks a thing from block map and sectors
P_UnsetThingPosition Unlinks a thing from block map and sectors
void P_UnsetThingPosition (mobj_t *thing)
{
	int				blockx, blocky;
	if ( ! (thing->flags & MF_NOSECTOR) )
	{	
		if (thing->snext)
			thing->snext->sprev = thing->sprev;
		if (thing->sprev)
			thing->sprev->snext = thing->snext;
		else
			thing->subsector->sector->thinglist = thing->snext;
	}
	if ( ! (thing->flags & MF_NOBLOCKMAP) )
	{	
		if (thing->bnext)
			thing->bnext->bprev = thing->bprev;
		if (thing->bprev)
			thing->bprev->bnext = thing->bnext;
		else
		{
			blockx = (thing->x - bmaporgx)>>MAPBLOCKSHIFT;
			blocky = (thing->y - bmaporgy)>>MAPBLOCKSHIFT;
			blocklinks[blocky*bmapwidth+blockx] = thing->bnext;
		}
	}
}
void P_UnsetThingPosition ( mobj_t * thing ) { int blockx , blocky ; if ( ! ( thing -> flags & MF_NOSECTOR ) ) { if ( thing -> snext ) thing -> snext -> sprev = thing -> sprev ; if ( thing -> sprev ) thing -> sprev -> snext = thing -> snext ; else thing -> subsector -> sector -> thinglist = thing -> snext ; } if ( ! ( thing -> flags & MF_NOBLOCKMAP ) ) { if ( thing -> bnext ) thing -> bnext -> bprev = thing -> bprev ; if ( thing -> bprev ) thing -> bprev -> bnext = thing -> bnext ; else { blockx = ( thing -> x - bmaporgx ) >> MAPBLOCKSHIFT ; blocky = ( thing -> y - bmaporgy ) >> MAPBLOCKSHIFT ; blocklinks [ blocky * bmapwidth + blockx ] = thing -> bnext ; } } }
P_UnsetThingPosition
Unlinks a thing from block map and sectors
P_UnsetThingPosition Unlinks a thing from block map and sectors
/* inert things don't need to be in blockmap */ /* unlink from subsector */ /* inert things don't need to be in blockmap */ /* unlink from block map */