diff --git a/polymer/eduke32/source/m32exec.c b/polymer/eduke32/source/m32exec.c index 41065f761..6710e86fb 100644 --- a/polymer/eduke32/source/m32exec.c +++ b/polymer/eduke32/source/m32exec.c @@ -1356,16 +1356,30 @@ skip_check: } break; case ITER_DRAWNSPRITES: + { + tspritetype lastSpriteBackup; + tspritetype *const lastSpritePtr = (tspritetype *)&sprite[MAXSPRITES-1]; + + // Back up sprite MAXSPRITES-1. + Bmemcpy(&lastSpriteBackup, lastSpritePtr, sizeof(tspritetype)); + for (int ii=0; ii= MAXSECTORS) goto badindex;