Browse Source

support older plugins that don't set p3d_offset

David Rose 16 years ago
parent
commit
af5efe447e
1 changed files with 3 additions and 5 deletions
  1. 3 5
      direct/src/plugin/p3dPythonRun.cxx

+ 3 - 5
direct/src/plugin/p3dPythonRun.cxx

@@ -1262,15 +1262,13 @@ add_package_info(P3DCInstance *inst, TiXmlElement *xpackage) {
 void P3DPythonRun::
 void P3DPythonRun::
 set_p3d_filename(P3DCInstance *inst, TiXmlElement *xfparams) {
 set_p3d_filename(P3DCInstance *inst, TiXmlElement *xfparams) {
   string p3d_filename;
   string p3d_filename;
-  int p3d_offset;
   const char *p3d_filename_c = xfparams->Attribute("p3d_filename");
   const char *p3d_filename_c = xfparams->Attribute("p3d_filename");
   if (p3d_filename_c != NULL) {
   if (p3d_filename_c != NULL) {
     p3d_filename = p3d_filename_c;
     p3d_filename = p3d_filename_c;
   }
   }
-  const char *p3d_offset_c = xfparams->Attribute("p3d_offset");
-  if (p3d_offset_c != NULL) {
-    p3d_offset = atoi(p3d_offset_c);
-  }
+
+  int p3d_offset = 0;
+  xfparams->Attribute("p3d_offset", &p3d_offset);
 
 
   PyObject *token_list = PyList_New(0);
   PyObject *token_list = PyList_New(0);
   TiXmlElement *xtoken = xfparams->FirstChildElement("token");
   TiXmlElement *xtoken = xfparams->FirstChildElement("token");