Skip to content
#3138
Auto-translated

function CheckRedStacks() --specifically, this is where I check for existence
while 1 do
for i, stack in red_squads do
if IsObjectExists(stack) == nil then
rednumber = 0 + 1;
end;
end;
end;
end;

function Checking()
while 1 do
sleep(5);
if rednumber == 1 then
SetObjectiveProgress('sec1', 1);
elseif rednumber == 2 then
SetObjectiveProgress('sec1', 2);

end;
end;
end;

...
function CheckRedStacks()
while 1 do
for stack, exists in red_squads do
if exists and (not IsObjectExists(stack)) then
red_squads[stack] = nil
rednumber = rednumber + 1
if GetObjectiveState('desired_quest') == OBJECTIVE_ACTIVE then
SetObjectiveProgress('desired_quest', rednumber)
end
end
end
sleep()
end
end
...

Why add a construct like "while 1 do ... end"?
I have nothing against it, I'm just curious