mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 00:42:08 +00:00
- flag all actors that override RunState.
This is for allowing quick checks of actors which need the special consideration.
This commit is contained in:
parent
2a38e83a2f
commit
96b0542cd8
1 changed files with 15 additions and 0 deletions
|
@ -503,6 +503,21 @@ void GameInterface::FinalizeSetup()
|
|||
// If identical, remove all ScriptAddresses from the class list.
|
||||
|
||||
}
|
||||
|
||||
// flag all actors which override RunState so we can quickly check for this in the game,
|
||||
auto VIndex = GetVirtualIndex(RUNTIME_CLASS(DDukeActor), "RunState");
|
||||
assert(VIndex != ~0u);
|
||||
auto RunState = RUNTIME_CLASS(DDukeActor)->Virtuals[VIndex];
|
||||
|
||||
for (auto& cls : PClassActor::AllActorClasses)
|
||||
{
|
||||
if (cls->IsDescendantOf(RUNTIME_CLASS(DDukeActor)) && cls->Virtuals[VIndex] != RunState)
|
||||
{
|
||||
auto def = static_cast<DDukeActor*>(GetDefaultByType(cls));
|
||||
def->flags4 |= SFLAG4_CONOVERRIDE;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue