fix DSDHacked state creation.
Some checks failed
Continuous Integration / Linux Clang 12 | AppImage (push) Has been cancelled
Continuous Integration / macOS | Debug (push) Has been cancelled
Continuous Integration / Linux Clang 11 | Debug (push) Has been cancelled
Continuous Integration / Visual Studio 2022 | Debug (push) Has been cancelled
Continuous Integration / Linux GCC 12 | MinSizeRel (push) Has been cancelled
Continuous Integration / Linux GCC 9 | RelWithDebInfo (push) Has been cancelled
Continuous Integration / macOS | Release (push) Has been cancelled
Continuous Integration / Linux Clang 15 | Release (push) Has been cancelled
Continuous Integration / Visual Studio 2019 | Release (push) Has been cancelled
Continuous Integration / Visual Studio 2022 | Release (push) Has been cancelled
Some checks failed
Continuous Integration / Linux Clang 12 | AppImage (push) Has been cancelled
Continuous Integration / macOS | Debug (push) Has been cancelled
Continuous Integration / Linux Clang 11 | Debug (push) Has been cancelled
Continuous Integration / Visual Studio 2022 | Debug (push) Has been cancelled
Continuous Integration / Linux GCC 12 | MinSizeRel (push) Has been cancelled
Continuous Integration / Linux GCC 9 | RelWithDebInfo (push) Has been cancelled
Continuous Integration / macOS | Release (push) Has been cancelled
Continuous Integration / Linux Clang 15 | Release (push) Has been cancelled
Continuous Integration / Visual Studio 2019 | Release (push) Has been cancelled
Continuous Integration / Visual Studio 2022 | Release (push) Has been cancelled
Several problems here: * the crucial call did not override 'mustexist'. * once created an extended stare would not be looked at anymore. * extended states received no usage flags.
This commit is contained in:
parent
22e8bea91b
commit
3d6664c28e
1 changed files with 16 additions and 11 deletions
|
|
@ -557,7 +557,7 @@ static FState *FindState (int statenum, bool mustexist)
|
|||
{
|
||||
if (stateacc <= statenum && stateacc + StateMap[i].StateSpan > statenum)
|
||||
{
|
||||
if (StateMap[i].State != NULL)
|
||||
if (StateMap[i].State != nullptr)
|
||||
{
|
||||
if (StateMap[i].OwnerIsPickup)
|
||||
{
|
||||
|
|
@ -565,23 +565,28 @@ static FState *FindState (int statenum, bool mustexist)
|
|||
}
|
||||
return StateMap[i].State + statenum - stateacc;
|
||||
}
|
||||
else return NULL;
|
||||
else break;
|
||||
}
|
||||
stateacc += StateMap[i].StateSpan;
|
||||
}
|
||||
if (dsdhacked && !mustexist)
|
||||
if (dsdhacked)
|
||||
{
|
||||
auto p = dehExtStates.CheckKey(statenum);
|
||||
if (p) return *p;
|
||||
auto state = (FState*)ClassDataAllocator.Alloc(sizeof(FState));
|
||||
dehExtStates.Insert(statenum, state);
|
||||
memset(state, 0, sizeof(*state));
|
||||
state->Tics = -1;
|
||||
state->NextState = state;
|
||||
state->DehIndex = statenum;
|
||||
if (!mustexist)
|
||||
{
|
||||
auto state = (FState*)ClassDataAllocator.Alloc(sizeof(FState));
|
||||
dehExtStates.Insert(statenum, state);
|
||||
memset(state, 0, sizeof(*state));
|
||||
state->Tics = -1;
|
||||
state->NextState = state;
|
||||
state->DehIndex = statenum;
|
||||
state->UseFlags = SUF_ACTOR | SUF_OVERLAY | SUF_WEAPON | SUF_ITEM;
|
||||
return state;
|
||||
}
|
||||
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int FindStyle (const char *namestr)
|
||||
|
|
@ -1832,7 +1837,7 @@ static int PatchFrame (int frameNum)
|
|||
int tics, misc1, frame;
|
||||
FState *info, dummy;
|
||||
|
||||
info = FindState (frameNum);
|
||||
info = FindState (frameNum, false);
|
||||
if (info)
|
||||
{
|
||||
DPrintf (DMSG_SPAMMY, "Frame %d\n", frameNum);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue