Implement changesprite{sect,stat} without temp. freelist insertion/deletion.

This is simply done by using the two list helper functions defined earlier
instead of a deletespriteX/insertspriteX pair.

git-svn-id: https://svn.eduke32.com/eduke32@2469 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-03-13 20:06:52 +00:00
parent 4e59887198
commit f996995fe5

View file

@ -7666,10 +7666,8 @@ int32_t changespritesect(int16_t spritenum, int16_t newsectnum)
if (sprite[spritenum].sectnum == MAXSECTORS) if (sprite[spritenum].sectnum == MAXSECTORS)
return(-1); return(-1);
deletespritesect(spritenum); do_deletespritesect(spritenum);
insertspritesect(newsectnum); do_insertsprite_at_headofsect(spritenum, newsectnum);
// do_deletespritesect(spritenum);
// do_insertsprite_at_headofsect(spritenum, newsectnum);
return(0); return(0);
} }
@ -7686,10 +7684,8 @@ int32_t changespritestat(int16_t spritenum, int16_t newstatnum)
if (sprite[spritenum].statnum == MAXSTATUS) if (sprite[spritenum].statnum == MAXSTATUS)
return(-1); // can't set the statnum of a sprite not in the world return(-1); // can't set the statnum of a sprite not in the world
deletespritestat(spritenum); do_deletespritestat(spritenum);
insertspritestat(newstatnum); do_insertsprite_at_headofstat(spritenum, newstatnum);
// do_deletespritestat(spritenum);
// do_insertsprite_at_headofstat(spritenum, newstatnum);
return(0); return(0);
} }