Add mhkreset maphack command

Thanks to LeoD.

git-svn-id: https://svn.eduke32.com/eduke32@8644 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2020-02-29 07:35:50 +00:00 committed by Christoph Oelckers
parent dc2d6a098e
commit da6c7ddab5
1 changed files with 20 additions and 0 deletions

View File

@ -54,6 +54,7 @@ int32_t engineLoadMHK(const char *filename)
T_MDPOSITIONZOFF,
T_AWAY1,
T_AWAY2,
T_MHKRESET,
T_LIGHT,
};
@ -87,6 +88,7 @@ int32_t engineLoadMHK(const char *filename)
{ "mdpositionzoff", T_MDPOSITIONZOFF },
{ "away1", T_AWAY1 },
{ "away2", T_AWAY2 },
{ "mhkreset", T_MHKRESET },
{ "light", T_LIGHT },
{ NULL, -1 }
};
@ -322,6 +324,24 @@ int32_t engineLoadMHK(const char *filename)
}
spriteext[whichsprite].flags |= SPREXT_AWAY2;
break;
case T_MHKRESET: // mhkreset
{
if (whichsprite < 0)
{
// no sprite directive preceeding
initprintf("Ignoring mhkreset directive because of absent/invalid sprite number on line %s:%d\n",
script->filename, scriptfile_getlinum(script, cmdtokptr));
break;
}
auto pSpriteExt = &spriteext[whichsprite];
pSpriteExt->angoff = 0;
pSpriteExt->flags &= ~(SPREXT_NOTMD|SPREXT_NOMDANIM|SPREXT_AWAY1|SPREXT_AWAY2);
pSpriteExt->pitch = 0;
pSpriteExt->roll = 0;
pSpriteExt->pivot_offset = {};
pSpriteExt->position_offset = {};
break;
}
#ifdef POLYMER
case T_LIGHT: // light sector x y z range r g b radius faderadius angle horiz minshade maxshade priority tilenum
{