Prechádzať zdrojové kódy

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

MelvMay-GG 12 rokov pred
rodič
commit
93be0d70ff
1 zmenil súbory, kde vykonal 3 pridanie a 2 odobranie
  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();