Skip to content

Commit

Permalink
Works around for #7
Browse files Browse the repository at this point in the history
  • Loading branch information
JujuAdams committed Nov 3, 2021
1 parent 1bc6a3c commit b3f3003
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Coroutines.yyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rooms/rmMain/rmMain.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions scripts/__CoroutineRootClass/__CoroutineRootClass.gml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ function __CoroutineInstantiate()
return _new;
}

function __CoroutineGetNext()
{
return global.__coroutineNext;
}

function __CoroutineBegin(_function)
{
if (__COROUTINES_CHECK_SYNTAX) __CoroutineCheckSyntax("CO_BEGIN");
Expand Down
4 changes: 2 additions & 2 deletions scripts/__CoroutinesSystem/__CoroutinesSystem.gml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ enum __COROUTINE_ESCAPE_STATE

#region What hath Science birthed on this Moon-less night

#macro CO_BEGIN ((function(){__CoroutineBegin(function(){
#macro CO_BEGIN __CoroutineGetNext();(function(){__CoroutineBegin(function(){ //__CoroutineGetNext() is required to work around GM compiler bug (https://github.com/JujuAdams/Coroutines/issues/7)
#macro CO_ON_COMPLETE });__CoroutineOnComplete(function(){
#macro CO_END });return __CoroutineEnd();})());
#macro CO_END });return __CoroutineEnd();})();
#macro THEN });__CoroutineThen(function(){
#macro YIELD });__CoroutineEscape(__COROUTINE_ESCAPE_STATE.__YIELD,function(){return
#macro PAUSE });__CoroutineEscape(__COROUTINE_ESCAPE_STATE.__PAUSE,function(){return
Expand Down

0 comments on commit b3f3003

Please sign in to comment.