rem: spawn_fighters (ElementPtr) PELEMENT ElementPtr;
add: spawn_fighters (PELEMENT ElementPtr)
context: spawn_fighters (ElementPtr)PELEMENT ElementPtr;{	SIZE i;	COUNT facing;	SIZE delta_x, delta_y;	HELEMENT hFighterElement;	STARSHIPPTR StarShipPtr;	GetElementStarShip (ElementPtr, &StarShipPtr);	facing = StarShipPtr->ShipFacing + ANGLE_TO_FACING (HALF_CIRCLE);	delta_x = COSINE (FACING_TO_ANGLE (facing), DISPLAY_TO_WORLD (14));	delta_y = SINE (FACING_TO_ANGLE (facing), DISPLAY_TO_WORLD (14));	i = ElementPtr->crew_level > 2 ? 2 : 1;	while (i-- && (hFighterElement = AllocElement ()))	{		SIZE sx, sy;		COUNT fighter_facing;		ELEMENTPTR FighterElementPtr;		DeltaCrew (ElementPtr, -1);		PutElement (hFighterElement);		LockElement (hFighterElement, &FighterElementPtr);		FighterElementPtr->hit_points = 1;		FighterElementPtr->mass_points = 0;		FighterElementPtr->thrust_wait = TRACK_THRESHOLD + 1;		FighterElementPtr->state_flags = APPEARING				| FINITE_LIFE | CREW_OBJECT | IGNORE_SIMILAR				| (ElementPtr->state_flags & (GOOD_GUY | BAD_GUY));		FighterElementPtr->life_span = FIGHTER_LIFE;		SetPrimType (&(GLOBAL (DisplayArray))[FighterElementPtr->PrimIndex],				STAMP_PRIM);		{			FighterElementPtr->preprocess_func = fighter_preprocess;			FighterElementPtr->postprocess_func = 0;			FighterElementPtr->collision_func = fighter_collision;			FighterElementPtr->death_func = NULL_PTR;		}		FighterElementPtr->current.location = ElementPtr->next.location;		if (i == 1)		{			FighterElementPtr->turn_wait = LEFT;			fighter_facing = NORMALIZE_FACING (facing + 2);			FighterElementPtr->current.location.x += delta_x - delta_y;			FighterElementPtr->current.location.y += delta_y + delta_x;		}		else		{			FighterElementPtr->turn_wait = RIGHT;			fighter_facing = NORMALIZE_FACING (facing - 2);			FighterElementPtr->current.location.x += delta_x + delta_y;			FighterElementPtr->current.location.y += delta_y - delta_x;		}		sx = COSINE (FACING_TO_ANGLE (fighter_facing),				WORLD_TO_VELOCITY (FIGHTER_SPEED));		sy = SINE (FACING_TO_ANGLE (fighter_facing),				WORLD_TO_VELOCITY (FIGHTER_SPEED));		SetVelocityComponents (&FighterElementPtr->velocity, sx, sy);		FighterElementPtr->current.location.x -= VELOCITY_TO_WORLD (sx);		FighterElementPtr->current.location.y -= VELOCITY_TO_WORLD (sy);		FighterElementPtr->current.image.farray = StarShipPtr->RaceDescPtr->ship_data.special;		FighterElementPtr->current.image.frame =				SetAbsFrameIndex (StarShipPtr->RaceDescPtr->ship_data.special[0],				fighter_facing);		SetElementStarShip (FighterElementPtr, StarShipPtr);		UnlockElement (hFighterElement);	}}