Originally Posted by Anitarf
Also, couldn't you just keep the unit permanently paused, instead of pausing and unpausing it each time?
While writing the code, I thought about that idea because I didn't want to trigger any events. However, when I tested it, it didn't work properly; it later turned out that ordering paused units always returned false. Then I just guessed wild and tried what it is now; it finally worked.