Fix IF scope

This commit is contained in:
bernat 2021-02-08 14:36:27 +01:00
parent 812508116e
commit 3bbc41f1b8
1 changed files with 2 additions and 0 deletions

View File

@ -64,9 +64,11 @@ FActorView FActorRegistry::Register(AActor &Actor, FActorDescription Description
if (DesiredId != 0 && Id != DesiredId) {
// check if the desired Id is free, then use it instead
if (!Actors.Contains(DesiredId))
{
Id = DesiredId;
if (ID_COUNTER < Id)
ID_COUNTER = Id;
}
}
Actors.Emplace(Id, &Actor);