Tried to fix an ArgumentOutOfRangeException in GetSpawnOccupants

as shown in #5588.