File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -190,15 +190,14 @@ void VirtualMachine::moveToLastCheckpoint()
190190 * \param[in] savePos Changes the return value of savePos().
191191 * \param[in] breakAtomic Whether to break the frame after stopping the script.
192192 * \param[in] goBack Whether to go back so that the current instruction can run again in the future.
193- * \note Nothing will happen if the script is set to run without screen refresh.
193+ * \note If the script is set to run without screen refresh, the VM won't stop.
194+ * The only parameter which won't be ignored is goBack.
194195 */
195196void VirtualMachine::stop (bool savePos, bool breakAtomic, bool goBack)
196197{
197- if (impl->warp )
198- return ;
199198 impl->stop = true ;
200- impl->savePos = savePos;
201- impl->atomic = !breakAtomic;
199+ impl->savePos = savePos && !impl-> warp ;
200+ impl->atomic = !breakAtomic || impl-> warp ;
202201 impl->goBack = goBack;
203202}
204203
Original file line number Diff line number Diff line change @@ -689,7 +689,11 @@ do_exec : {
689689 // This is for example used in the wait block (to call it again with the same time value).
690690 } else
691691 FREE_REGS (ret);
692- return pos;
692+
693+ if (!warp) // TODO: This should always return if there's a "warp timer" enabled
694+ return pos;
695+
696+ DISPATCH (); // this avoids freeing registers after "stopping" a warp script
693697 }
694698 FREE_REGS (ret);
695699 DISPATCH ();
You can’t perform that action at this time.
0 commit comments