mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- fixed: Dehacked must flag all states it touched for use in weapons.
This commit is contained in:
parent
b132782c49
commit
4be9222646
1 changed files with 14 additions and 0 deletions
|
@ -238,6 +238,7 @@ TArray<PClassActor *> TouchedActors;
|
||||||
|
|
||||||
char *UnchangedSpriteNames;
|
char *UnchangedSpriteNames;
|
||||||
int NumUnchangedSprites;
|
int NumUnchangedSprites;
|
||||||
|
bool changedStates;
|
||||||
|
|
||||||
// Sprite<->Class map for ADehackedPickup::DetermineType
|
// Sprite<->Class map for ADehackedPickup::DetermineType
|
||||||
static struct DehSpriteMap
|
static struct DehSpriteMap
|
||||||
|
@ -988,6 +989,7 @@ static int PatchThing (int thingy)
|
||||||
{
|
{
|
||||||
statedef.MakeStateDefines(type);
|
statedef.MakeStateDefines(type);
|
||||||
patchedStates = true;
|
patchedStates = true;
|
||||||
|
changedStates = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strnicmp (Line1, "Initial", 7))
|
if (!strnicmp (Line1, "Initial", 7))
|
||||||
|
@ -1460,6 +1462,7 @@ static int PatchFrame (int frameNum)
|
||||||
else if (keylen == 10 && stricmp (Line1, "Next frame") == 0)
|
else if (keylen == 10 && stricmp (Line1, "Next frame") == 0)
|
||||||
{
|
{
|
||||||
info->NextState = FindState (val);
|
info->NextState = FindState (val);
|
||||||
|
changedStates = true;
|
||||||
}
|
}
|
||||||
else if (keylen == 16 && stricmp (Line1, "Sprite subnumber") == 0)
|
else if (keylen == 16 && stricmp (Line1, "Sprite subnumber") == 0)
|
||||||
{
|
{
|
||||||
|
@ -3049,6 +3052,17 @@ void FinishDehPatch ()
|
||||||
DPrintf (DMSG_NOTIFY, "%s replaces %s\n", subclass->TypeName.GetChars(), type->TypeName.GetChars());
|
DPrintf (DMSG_NOTIFY, "%s replaces %s\n", subclass->TypeName.GetChars(), type->TypeName.GetChars());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// To avoid errors, flag all potentially touched states for use in weapons.
|
||||||
|
if (changedStates)
|
||||||
|
{
|
||||||
|
for (auto &s : StateMap)
|
||||||
|
{
|
||||||
|
for (auto i = 0; i < s.StateSpan; i++)
|
||||||
|
{
|
||||||
|
s.State[i].UseFlags |= SUF_WEAPON;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Now that all Dehacked patches have been processed, it's okay to free StateMap.
|
// Now that all Dehacked patches have been processed, it's okay to free StateMap.
|
||||||
StateMap.Clear();
|
StateMap.Clear();
|
||||||
StateMap.ShrinkToFit();
|
StateMap.ShrinkToFit();
|
||||||
|
|
Loading…
Reference in a new issue