- added a level iterator for operations that need to make changes to all open levels.

Since currently there is only one level, this will obvciously only run once on that level for the time being.

This is mainly used for CCMDs and CVARs which either print some diagnostics or change some user-settable configuration.
This commit is contained in:
Christoph Oelckers 2019-01-28 02:41:29 +01:00
commit d941dea005
23 changed files with 198 additions and 126 deletions

View file

@ -488,6 +488,8 @@ void DObject::StaticPointerSubstitution (AActor *old, AActor *notOld)
DObject *probe;
size_t changed = 0;
int i;
if (old == nullptr) return;
// Go through all objects.
i = 0;DObject *last=0;
@ -515,8 +517,8 @@ void DObject::StaticPointerSubstitution (AActor *old, AActor *notOld)
}
}
// Go through sectors.
for (auto &sec : level.sectors)
// Go through sectors. Only the level this actor belongs to is relevant.
for (auto &sec : old->Level->sectors)
{
if (sec.SoundTarget == old) sec.SoundTarget = notOld;
}