diff --git a/direct/src/plugin_standalone/p3dEmbed.cxx b/direct/src/plugin_standalone/p3dEmbed.cxx index 0645acd9b3..26beeb54a5 100644 --- a/direct/src/plugin_standalone/p3dEmbed.cxx +++ b/direct/src/plugin_standalone/p3dEmbed.cxx @@ -28,6 +28,10 @@ P3DEmbed(bool console_environment) : Panda3DBase(console_environment) { // Since the Panda3DBase constructor no longer assigns _root_dir, we // have to do it here. _root_dir = find_root_dir(); + + // We should leave the arguments intact, just pass them + // 1:1 as we've received them. + _prepend_filename_to_args = false; } //////////////////////////////////////////////////////////////////// diff --git a/direct/src/plugin_standalone/panda3dBase.cxx b/direct/src/plugin_standalone/panda3dBase.cxx index 5f4ebba30d..d47a3e5f4d 100644 --- a/direct/src/plugin_standalone/panda3dBase.cxx +++ b/direct/src/plugin_standalone/panda3dBase.cxx @@ -72,6 +72,8 @@ Panda3DBase(bool console_environment) { // Seed the lame random number generator in rand(); we use it to // select a mirror for downloading. srand((unsigned int)time(NULL)); + + _prepend_filename_to_args = true; } //////////////////////////////////////////////////////////////////// @@ -379,7 +381,9 @@ create_instance(const string &p3d, bool start_instance, // Build up the argument list, beginning with the p3d_filename. pvector argv; - argv.push_back(os_p3d_filename.c_str()); + if (_prepend_filename_to_args) { + argv.push_back(os_p3d_filename.c_str()); + } for (int i = 0; i < num_args; ++i) { argv.push_back(args[i]); } diff --git a/direct/src/plugin_standalone/panda3dBase.h b/direct/src/plugin_standalone/panda3dBase.h index b71ab22cdc..87d886e2bd 100755 --- a/direct/src/plugin_standalone/panda3dBase.h +++ b/direct/src/plugin_standalone/panda3dBase.h @@ -89,6 +89,7 @@ protected: bool _reporting_download; bool _enable_security; bool _console_environment; + bool _prepend_filename_to_args; typedef pset Instances; Instances _instances;