short FindBreakSpriteMatch ( short match ) { short i, nexti; TRAVERSE_SPRITE_STAT ( headspritestat[STAT_BREAKABLE], i, nexti ) { if ( SPRITE_TAG2 ( i ) == match && sprite[i].picnum == ST1 ) { return ( i ); } } return ( -1 ); }
void CopySectorMatch(short match) { short ed,nexted,ss,nextss; SPRITEp dest_sp, src_sp; SECTORp dsectp,ssectp; short kill, nextkill; SPRITEp k; TRAVERSE_SPRITE_STAT(headspritestat[STAT_COPY_DEST], ed, nexted) { dest_sp = &sprite[ed]; dsectp = §or[dest_sp->sectnum]; if (match != sprite[ed].lotag) continue; TRAVERSE_SPRITE_STAT(headspritestat[STAT_COPY_SOURCE], ss, nextss) { src_sp = &sprite[ss]; if (SP_TAG2(src_sp) == SPRITE_TAG2(ed) && SP_TAG3(src_sp) == SPRITE_TAG3(ed)) { short src_move, nextsrc_move; ssectp = §or[src_sp->sectnum]; // !!!!!AAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHH // Don't kill anything you don't have to // this wall killing things on a Queue causing // invalid situations #if 1 // kill all sprites in the dest sector that need to be TRAVERSE_SPRITE_SECT(headspritesect[dest_sp->sectnum], kill, nextkill) { k = &sprite[kill]; // kill anything not invisible if (!TEST(k->cstat, CSTAT_SPRITE_INVISIBLE)) { if (User[kill]) { // be safe with the killing //SetSuicide(kill); } else { SpriteQueueDelete(kill); // new function to allow killing - hopefully KillSprite(kill); } } }