private static Int32 Unknown__SetStateHook(IntPtr @this, Boolean endMap, Boolean endEngine) { Trace.WriteLine("Unknown__SetState @this[0]: " + Memory.Read <IntPtr>(@this).ToString("X8")); try { if (endEngine) { if (InternalGame.IsInMap) { InternalGame.IsInMap = false; InternalGame.OnMapEnd(); } if (InternalGame.IsEngineRunning) { InternalGame.IsEngineRunning = false; InternalGame.OnEngineEnd(); } } else { if (endMap) { if (InternalGame.IsInMap) { InternalGame.IsInMap = false; InternalGame.OnMapEnd(); } } else { if (!InternalGame.IsEngineRunning) { InternalGame.OnEngineStart(); InternalGame.IsEngineRunning = true; } if (InternalGame.IsInMap) { InternalGame.OnMapEnd(); } InternalGame.OnMapStart(); InternalGame.IsInMap = true; } } } catch (Exception e) { Trace.WriteLine("Unhandled Exception in InternalGame.Unknown__SetStateHook!"); Trace.WriteLine(e.ToString()); } return(InternalGame.Unknown__SetState(@this, endMap, endEngine)); }
private static void OnMapStart() { try { if (InternalGame.MapStart != null) { InternalGame.MapStart(); } } catch (Exception e) { Trace.WriteLine("Unhandled Exception in InternalGame.OnMapStart!"); Trace.WriteLine(e.ToString()); } }
private static void OnEngineEnd() { try { if (InternalGame.EngineEnd != null) { InternalGame.EngineEnd(); } } catch (Exception e) { Trace.WriteLine("Unhandled Exception in InternalGame.OnEngineEnd!"); Trace.WriteLine(e.ToString()); } }