diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 07bf3dfb0..4ffb18f96 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -1290,6 +1290,12 @@ int32_t clipmapinfo_load(const char *filename) if (pn<=0 || pn>=MAXTILES || k<0 || k>=numsectors || (sectoidx[k]&CM_OUTER)) continue; + if (numclipmaps >= CM_MAX) + { + initprintf("warning: reached max clip map number %d, not processing any more\n", CM_MAX); + break; + } + // chain if (pictoidx[pn]>=0) { @@ -9310,6 +9316,8 @@ int32_t loadmaphack(const char *filename) static char fn[BMAX_PATH]; #ifdef POLYMER + int32_t toomanylights = 0; + for (i=0; i=0) - maphacklight[maphacklightcnt++] = lightid; - } + { + if (maphacklightcnt == PR_MAXLIGHTS) + { + initprintf("warning: max light count %d exceeded, " + "ignoring further light defs\n", PR_MAXLIGHTS); + toomanylights = 1; + break; + } + + lightid = polymer_addlight(&light); + if (lightid>=0) + maphacklight[maphacklightcnt++] = lightid; + } break; } diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 15c6c15d7..ffee0a723 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -650,7 +650,9 @@ void Sect_ClearInterpolation(int32_t sectnum) static int32_t move_fixed_sprite(int32_t j, int32_t pivotspr, int32_t daang) { - if ((FIXSPR_STATNUMP(sprite[j].statnum) || (sprite[j].picnum==SECTOREFFECTOR && (sprite[j].lotag==49||sprite[j].lotag==50))) + if ((FIXSPR_STATNUMP(sprite[j].statnum) || + (sprite[j].picnum==SECTOREFFECTOR && (sprite[j].lotag==49||sprite[j].lotag==50)) || + ((sprite[j].statnum==1 || sprite[j].statnum==2) && (ActorType[sprite[j].picnum]&4))) && actor[j].t_data[7]==(0x18190000|pivotspr)) { rotatepoint(0,0, actor[j].t_data[8],actor[j].t_data[9], daang&2047, &sprite[j].x,&sprite[j].y); diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 2fa237f09..692451ec1 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -4091,7 +4091,7 @@ static void tilescreen_drawbox(int32_t iTopLeft, int32_t iSelected, int32_t nXTi int32_t x1 = ((iTile-iTopLeft) % nXTiles)*TileDim; int32_t y1 = ((iTile - ((iTile-iTopLeft) % nXTiles) - iTopLeft)/nXTiles)*TileDim + offset; int32_t x2 = x1+TileDim-1; - int32_t y2 = y1+TileDim-1; + int32_t y2 = y1+TileDim-1, oydim16=ydim16; char markedcol = editorcolors[14]; @@ -4100,6 +4100,9 @@ static void tilescreen_drawbox(int32_t iTopLeft, int32_t iSelected, int32_t nXTi y1=max(y1, 0); y2=min(y2, ydim-1); + // plotlines2d uses drawline16, which clips against ydim16... + ydim16 = ydim; + { // box int32_t xx[] = {x1, x1, x2, x2, x1}; @@ -4117,6 +4120,8 @@ static void tilescreen_drawbox(int32_t iTopLeft, int32_t iSelected, int32_t nXTi swaplong(&yy[0], &yy[1]); plotlines2d(xx, yy, 2, markedcol); } + + ydim16 = oydim16; } } diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 8096263c2..02c6fbb66 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -2646,15 +2646,17 @@ static int32_t C_ParseCommand(int32_t loop) if (tw == CON_USERACTOR) { - j = *g_scriptPtr; - - if (j > 2) - { - C_ReportError(-1); - initprintf("%s:%d: warning: invalid useractor type.\n",g_szScriptFileName,g_lineNumber); - g_numCompilerWarnings++; - j = 0; - } + j = *g_scriptPtr; + + if (j > 6 || (j&3)==3) + { + C_ReportError(-1); + initprintf("%s:%d: warning: invalid useractor type. Must be 0, 1, 2" + " (notenemy, enemy, enemystayput) or have 4 added ('doesn't move').\n", + g_szScriptFileName,g_lineNumber); + g_numCompilerWarnings++; + j = 0; + } } C_GetNextValue(LABEL_DEFINE); @@ -2662,9 +2664,9 @@ static int32_t C_ParseCommand(int32_t loop) if (tw == CON_EVENTLOADACTOR) { - actorLoadEventScrptr[*g_scriptPtr] = g_parsingActorPtr; - g_checkingIfElse = 0; - continue; + actorLoadEventScrptr[*g_scriptPtr] = g_parsingActorPtr; + g_checkingIfElse = 0; + continue; } actorscrptr[*g_scriptPtr] = g_parsingActorPtr; diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 7aed7b900..226dd0294 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -1016,7 +1016,7 @@ static inline void G_SetupBackdrop(int16_t sky) pskybits=3; } -// tweak moving sectors with these SE lotags (bitmap) +// tweak moving sectors with these SE lotags #define FIXSPR_SELOTAGP(k) ((k==0) || (k==6) || (k==14)) // setup sprites in moving sectors that are to be fixed wrt a certain pivot @@ -1039,7 +1039,8 @@ static void premap_setup_fixed_sprites(void) // TRIPBOMB uses t_data[7] for its own purposes. Wouldn't be // too useful with moving sectors anyway if ((FIXSPR_STATNUMP(sprite[j].statnum) && sprite[j].picnum!=TRIPBOMB) || - (sprite[j].picnum==SECTOREFFECTOR && (sprite[j].lotag==49||sprite[j].lotag==50))) + (sprite[j].picnum==SECTOREFFECTOR && (sprite[j].lotag==49||sprite[j].lotag==50)) || + ((sprite[j].statnum==1 || sprite[j].statnum==2) && (ActorType[sprite[j].picnum]&4))) { pivot = i; if (sprite[i].lotag==0)