Fix focus rolling invisible elves

This commit is contained in:
thepaperpilot 2022-12-14 20:24:53 -06:00
parent 2fc424c7e3
commit a3453b84ac

View file

@ -1309,8 +1309,9 @@ const layer = createLayer(id, () => {
focusTargets.value = {};
const newCount = Decimal.min(count, range);
while (newCount.gt(x)) {
const roll = Object.values(elfTraining)[Math.floor(Math.random() * range)]?.name ?? "";
if (!focusTargets.value[roll]) {
const elf = Object.values(elfTraining)[Math.floor(Math.random() * range)];
const roll = elf?.name ?? "";
if (!focusTargets.value[roll] && unref(elf.visibility) === Visibility.Visible) {
focusTargets.value[roll] = true;
x++;
}