diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index c571c2688..e0e4e4d2b 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -1344,6 +1344,8 @@ const memberlabel_t PalDataLabels[]= const tokenmap_t iter_tokens [] = { { "allsprites", ITER_ALLSPRITES }, + { "allspritesbystat",ITER_ALLSPRITESBYSTAT }, + { "allspritesbysect",ITER_ALLSPRITESBYSECT }, { "allsectors", ITER_ALLSECTORS }, { "allwalls", ITER_ALLWALLS }, { "activelights", ITER_ACTIVELIGHTS }, diff --git a/source/duke3d/src/gamedef.h b/source/duke3d/src/gamedef.h index b671400f1..1d9c8c439 100644 --- a/source/duke3d/src/gamedef.h +++ b/source/duke3d/src/gamedef.h @@ -781,6 +781,8 @@ enum ProjectileLabel_t enum IterationTypes_t { ITER_ALLSPRITES, + ITER_ALLSPRITESBYSTAT, + ITER_ALLSPRITESBYSECT, ITER_ALLSECTORS, ITER_ALLWALLS, ITER_ACTIVELIGHTS, diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index 2d0343e90..b4eea4d53 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -5275,6 +5275,17 @@ finish_qsprintf: switch (iterType) { case ITER_ALLSPRITES: + for (native_t jj=0; jj=0;) @@ -5287,6 +5298,19 @@ finish_qsprintf: } } break; + case ITER_ALLSPRITESBYSECT: + for (native_t sectNum=0; sectNum=0;) + { + int const kk=nextspritesect[jj]; + Gv_SetVarX(returnVar, jj); + insptr = pNext; + VM_Execute(0); + jj=kk; + } + } + break; case ITER_ALLSECTORS: for (native_t jj=0; jj