Browse Source

- Only call the "onExit" method if it exists.

MelvMay-GG 12 years ago
parent
commit
93be0d7
1 changed files with 3 additions and 2 deletions
  1. 3 2
      engine/source/game/defaultGame.cc

+ 3 - 2
engine/source/game/defaultGame.cc

@@ -326,8 +326,9 @@ void shutdownGame()
     if( Con::isFunction("onPreExit") )
         Con::executef(1, "onPreExit");
 
-    //exec the script onExit() function
-    Con::executef(1, "onExit");
+    // Perform the exit callback.
+    if( Con::isFunction("onExit") )
+        Con::executef(1, "onExit");
 
     // Unregister the module database.
     ModuleDatabase.unregisterObject();