Browse Source

Merge pull request #233 from Hoikas/py_system_error

Fix Scary SystemErrors
Branan Purvine-Riley 12 years ago
parent
commit
a76cb3f18d
  1. 9
      Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp

9
Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp

@ -859,14 +859,14 @@ void plPythonFileMod::AddTarget(plSceneObject* sobj)
// We should really let the script know about that via OnServerInitComplete anyway because it's
// not good to make assumptions about game state in workarounds for that method not being called
plNetClientApp* na = plNetClientApp::GetInstance();
if (!na->GetFlagsBit(plNetClientApp::kLoadingInitialAgeState) &&
na->GetFlagsBit(plNetClientApp::kPlayingGame))
if (!na->GetFlagsBit(plNetClientApp::kLoadingInitialAgeState) && na->GetFlagsBit(plNetClientApp::kPlayingGame))
{
plgDispatch::Dispatch()->UnRegisterForExactType(plInitialAgeStateLoadedMsg::Index(), GetKey());
if (fPyFunctionInstances[kfunc_OnServerInitComplete])
{
plProfile_BeginTiming(PythonUpdate);
// call it
PyObject* retVal = PyObject_CallMethod(
fPyFunctionInstances[kfunc_OnServerInitComplete],
PyObject* retVal = PyObject_CallMethod(fPyFunctionInstances[kfunc_OnServerInitComplete],
(char*)fFunctionNames[kfunc_OnServerInitComplete], nil);
if ( retVal == nil )
{
@ -882,6 +882,7 @@ void plPythonFileMod::AddTarget(plSceneObject* sobj)
// display any output (NOTE: this would be disabled in production)
DisplayPythonOutput();
}
}
// display python output
DisplayPythonOutput();

Loading…
Cancel
Save