Allow CON-specified actions to override hardcoded tsprpicnum behavior of PLAYERONWATER, CAMERA1, and RAT

git-svn-id: https://svn.eduke32.com/eduke32@7677 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-05-19 19:57:10 +00:00 committed by Christoph Oelckers
parent a4b30b5b90
commit a9e0c9afe1

View file

@ -4089,7 +4089,7 @@ PALONLY:
if (G_HaveActor(pSprite->picnum)) if (G_HaveActor(pSprite->picnum))
{ {
#if !defined LUNATIC #if !defined LUNATIC
if ((unsigned)scrofs_action + ACTION_VIEWTYPE >= (unsigned)g_scriptSize) if ((unsigned)scrofs_action + ACTION_PARAM_COUNT > (unsigned)g_scriptSize)
goto skip; goto skip;
l = apScript[scrofs_action + ACTION_VIEWTYPE]; l = apScript[scrofs_action + ACTION_VIEWTYPE];
@ -4257,6 +4257,12 @@ skip:
} }
} }
#ifdef LUNATIC
bool const haveAction = false; // FIXME!
#else
bool const haveAction = scrofs_action != 0 && (unsigned)scrofs_action + ACTION_PARAM_COUNT > (unsigned)g_scriptSize;
#endif
switch (DYNAMICTILEMAP(pSprite->picnum)) switch (DYNAMICTILEMAP(pSprite->picnum))
{ {
#ifndef EDUKE32_STANDALONE #ifndef EDUKE32_STANDALONE
@ -4306,6 +4312,9 @@ skip:
t->picnum += (pSprite->shade>>1); t->picnum += (pSprite->shade>>1);
break; break;
case PLAYERONWATER__STATIC: case PLAYERONWATER__STATIC:
t->shade = sprite[pSprite->owner].shade;
if (haveAction)
break;
#ifdef USE_OPENGL #ifdef USE_OPENGL
if (videoGetRenderMode() >= REND_POLYMOST && usemodels && md_tilehasmodel(pSprite->picnum,pSprite->pal) >= 0 && !(spriteext[i].flags&SPREXT_NOTMD)) if (videoGetRenderMode() >= REND_POLYMOST && usemodels && md_tilehasmodel(pSprite->picnum,pSprite->pal) >= 0 && !(spriteext[i].flags&SPREXT_NOTMD))
{ {
@ -4317,8 +4326,6 @@ skip:
frameOffset = getofs_viewtype_mirrored<5>(t->cstat, t->ang - oura); frameOffset = getofs_viewtype_mirrored<5>(t->cstat, t->ang - oura);
t->picnum = pSprite->picnum+frameOffset+((T1(i)<4)*5); t->picnum = pSprite->picnum+frameOffset+((T1(i)<4)*5);
t->shade = sprite[pSprite->owner].shade;
break; break;
case WATERSPLASH2__STATIC: case WATERSPLASH2__STATIC:
@ -4365,6 +4372,8 @@ skip:
case CAMERA1__STATIC: case CAMERA1__STATIC:
case RAT__STATIC: case RAT__STATIC:
if (haveAction)
break;
#ifdef USE_OPENGL #ifdef USE_OPENGL
if (videoGetRenderMode() >= REND_POLYMOST && usemodels && md_tilehasmodel(pSprite->picnum,pSprite->pal) >= 0 && !(spriteext[i].flags&SPREXT_NOTMD)) if (videoGetRenderMode() >= REND_POLYMOST && usemodels && md_tilehasmodel(pSprite->picnum,pSprite->pal) >= 0 && !(spriteext[i].flags&SPREXT_NOTMD))
{ {