Closed Coryf88 closed 2 years ago
This is actually not a bug with SQF-VM but one of those minor details in which SQF-VM differs from arma behavior.
The technical detail here is that the way, async behavior is archived with SQF-VM, is by regulary suspending all code (essentially having no actual unscheduled code) and thus allowing other script-handles to run. This however means that the "desired" behavior (which really is not desired for SQF-VM) cannot be archived.
Needless to say that i am open for additional input here, eg adding a switch that forces continous execution or an instruction or what not, but will for now mark this as "Wont Fix".
Describe the bug Blocking the unscheduled environment doesn't prevent the scheduled environment from executing.
To Reproduce
sqfvm.exe -a --sqf "private _iterations = 0; private _handle = 0 spawn {}; while { !scriptDone _handle } do { _iterations = _iterations + 1 }; [scriptDone _handle, _iterations]"
[INF] Context droped with return value '[true, 20]'.
Expected behavior
[INF] Context droped with return value '[false, 10000]'.
Screenshots![image](https://user-images.githubusercontent.com/204475/144932419-297e6e40-4535-4e0b-a19c-c953c8e164e1.png)
Additional context Expected behavior depends on #183 being fixed.