Creating an NRaas project Attn C# Devs: Overwatch
Not more harm than a typical error, but the Sleep didn't occur, the check is done before and apparently EA checks for yielding context even if they're not going to use Sleep() and it seems to be related to animations somehow. So no, no harm, unless it happens during loadup, in which case it will mess up the whole loadup sequence and you'll have an apocalypse, but as long as you don't save it's going to be fine (I had that once, I was scared....)
That I don't know. Tipically it's always done before running a task that will yield, which means it will run under the Simulator. The problem being that EA doesn't return after checking the yielding context, they keep the code going and make it stop by throwing an exception. Without ErrorTrap that translates into unexpected behavior
The very same Sleep() is done like that :
<!-- ws:start:WikiTextCodeRule:0:
<pre class="text">public static void Sleep(uint tickCount)<br/>{<br/> Simulator.CheckYieldingContext();<br/> Simulator.gSimulator.Sleep(tickCount);<br/>}</pre>
-->
<style type="text/css"><!--
/**
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
*/
.text {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }
-->
</style><pre class="text">public static void Sleep(uint tickCount)
{
Simulator.CheckYieldingContext();
Simulator.gSimulator.Sleep(tickCount);
}</pre>
See what I mean, they don't go back if it's not a yielding context, they let it go on anyway. In other places though, they do return if it's false. I don't know what to think of it...
<!-- ws:start:WikiTextCodeRule:0:
<pre class="text">public static void Sleep(uint tickCount)<br/>{<br/> Simulator.CheckYieldingContext();<br/> Simulator.gSimulator.Sleep(tickCount);<br/>}</pre>
-->
<style type="text/css"><!--
/**
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
*/
.text {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }
-->
</style><pre class="text">public static void Sleep(uint tickCount)
{
Simulator.CheckYieldingContext();
Simulator.gSimulator.Sleep(tickCount);
}</pre>
See what I mean, they don't go back if it's not a yielding context, they let it go on anyway. In other places though, they do return if it's false. I don't know what to think of it...