mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 05:51:20 +00:00
- fixed getting state name with incomplete list of actor classes
https://forum.zdoom.org/viewtopic.php?t=69713
This commit is contained in:
parent
fb20730960
commit
f46e3bacb2
3 changed files with 12 additions and 4 deletions
|
@ -172,7 +172,7 @@ public:
|
|||
|
||||
static PClassActor *StaticFindStateOwner (const FState *state);
|
||||
static PClassActor *StaticFindStateOwner (const FState *state, PClassActor *info);
|
||||
static FString StaticGetStateName(const FState *state);
|
||||
static FString StaticGetStateName(const FState *state, PClassActor *info = nullptr);
|
||||
static FRandom pr_statetics;
|
||||
|
||||
};
|
||||
|
|
|
@ -128,9 +128,17 @@ PClassActor *FState::StaticFindStateOwner (const FState *state, PClassActor *inf
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FString FState::StaticGetStateName(const FState *state)
|
||||
FString FState::StaticGetStateName(const FState *state, PClassActor *info)
|
||||
{
|
||||
auto so = FState::StaticFindStateOwner(state);
|
||||
if (so == nullptr)
|
||||
{
|
||||
so = FState::StaticFindStateOwner(state, info);
|
||||
}
|
||||
if (so == nullptr)
|
||||
{
|
||||
return "<unknown>";
|
||||
}
|
||||
return FStringf("%s.%d", so->TypeName.GetChars(), int(state - so->GetStates()));
|
||||
}
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ static void CheckLabel(PClassActor *obj, FStateLabel *slb, int useflag, FName st
|
|||
if (!(state->UseFlags & useflag))
|
||||
{
|
||||
GetStateSource(state).Message(MSG_ERROR, TEXTCOLOR_RED "%s references state %s as %s state, but this state is not flagged for use as %s.\n",
|
||||
obj->TypeName.GetChars(), FState::StaticGetStateName(state).GetChars(), statename.GetChars(), descript);
|
||||
obj->TypeName.GetChars(), FState::StaticGetStateName(state, obj).GetChars(), statename.GetChars(), descript);
|
||||
}
|
||||
}
|
||||
if (slb->Children != nullptr)
|
||||
|
@ -372,7 +372,7 @@ static void CheckStates(PClassActor *obj)
|
|||
if (state->NextState && (state->UseFlags & state->NextState->UseFlags) != state->UseFlags)
|
||||
{
|
||||
GetStateSource(state).Message(MSG_ERROR, TEXTCOLOR_RED "State %s links to a state with incompatible restrictions.\n",
|
||||
FState::StaticGetStateName(state).GetChars());
|
||||
FState::StaticGetStateName(state, obj).GetChars());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue