mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
Fixed crash on attempt to register IDs for undefined class
https://forum.zdoom.org/viewtopic.php?t=46670&start=16#p1021785
This commit is contained in:
parent
57ecc4ce30
commit
65966badb2
1 changed files with 12 additions and 4 deletions
16
src/info.cpp
16
src/info.cpp
|
@ -355,8 +355,16 @@ void PClassActor::RegisterIDs()
|
|||
return;
|
||||
}
|
||||
|
||||
FActorInfo *actorInfo = ActorInfo();
|
||||
|
||||
if (nullptr == actorInfo)
|
||||
{
|
||||
// Undefined class, exiting
|
||||
return;
|
||||
}
|
||||
|
||||
// Conversation IDs have never been filtered by game so we cannot start doing that.
|
||||
auto ConversationID = ActorInfo()->ConversationID;
|
||||
auto ConversationID = actorInfo->ConversationID;
|
||||
if (ConversationID > 0)
|
||||
{
|
||||
StrifeTypes[ConversationID] = cls;
|
||||
|
@ -365,9 +373,9 @@ void PClassActor::RegisterIDs()
|
|||
Printf(TEXTCOLOR_RED"Conversation ID %d refers to hidden class type '%s'\n", ConversationID, cls->TypeName.GetChars());
|
||||
}
|
||||
}
|
||||
if (ActorInfo()->GameFilter == GAME_Any || (ActorInfo()->GameFilter & gameinfo.gametype))
|
||||
if (actorInfo->GameFilter == GAME_Any || (ActorInfo()->GameFilter & gameinfo.gametype))
|
||||
{
|
||||
auto SpawnID = ActorInfo()->SpawnID;
|
||||
auto SpawnID = actorInfo->SpawnID;
|
||||
if (SpawnID > 0)
|
||||
{
|
||||
SpawnableThings[SpawnID] = cls;
|
||||
|
@ -376,7 +384,7 @@ void PClassActor::RegisterIDs()
|
|||
Printf(TEXTCOLOR_RED"Spawn ID %d refers to hidden class type '%s'\n", SpawnID, cls->TypeName.GetChars());
|
||||
}
|
||||
}
|
||||
auto DoomEdNum = ActorInfo()->DoomEdNum;
|
||||
auto DoomEdNum = actorInfo->DoomEdNum;
|
||||
if (DoomEdNum != -1)
|
||||
{
|
||||
FDoomEdEntry *oldent = DoomEdMap.CheckKey(DoomEdNum);
|
||||
|
|
Loading…
Reference in a new issue