diff --git a/stdlib/system.sun b/stdlib/system.sun index e7e7a32..35f445e 100644 --- a/stdlib/system.sun +++ b/stdlib/system.sun @@ -62,16 +62,10 @@ builtin startMareBottleDemo(); builtin isFinishMareBottleDemo(); function waitForFinishDemo() { - while (true) { - if (isDemoMode()) { - break; - } + while (!isDemoMode()) { yield; } - while (true) { - if (isDemoMode() == false) { - break; - } + while (isDemoMode()) { yield; } } diff --git a/stdlib/talk.sun b/stdlib/talk.sun index 1c18e0d..e857bbb 100644 --- a/stdlib/talk.sun +++ b/stdlib/talk.sun @@ -56,7 +56,7 @@ function talk(msgID, flags) { } else { yield; - while (getTalkMode() != true) { + while (!getTalkMode()) { yield; } } @@ -81,10 +81,9 @@ function select(msgID, flags) { } } else { - yield; - while (getTalkMode() != true) { + do { yield; - } + } while (!getTalkMode()); } return getTalkSelectedValue(); } @@ -103,20 +102,20 @@ builtin forceCloseTalk(); // functions function forceTalk(handle) { - var res = __forceStartTalk(handle); - if (res == true) { + var result = __forceStartTalk(handle); + if (result) { while (!isTalkModeNow()) { yield; } } - return res; + return result; } function forceTalkExceptNpc(handle) { - var res = __forceStartTalkExceptNpc(handle); - if (res == true) { + var result = __forceStartTalkExceptNpc(handle); + if (result) { while (!isTalkModeNow()) { yield; } } - return res; + return result; }