Allow plugins without git description to be loaded

develop
lethosor 2015-06-25 11:46:04 -04:00
parent 524593a3d3
commit 5d1ae9f5ed
1 changed files with 8 additions and 4 deletions

@ -230,7 +230,6 @@ bool Plugin::load(color_ostream &con)
plugin_check_symbol("plugin_self")
plugin_check_symbol("plugin_init")
plugin_check_symbol("plugin_globals")
plugin_check_symbol("git_description")
const char ** plug_name =(const char ** ) LookupPlugin(plug, "name");
const char ** plug_version =(const char ** ) LookupPlugin(plug, "version");
const char ** plug_git_description = (const char**) LookupPlugin(plug, "git_description");
@ -244,9 +243,14 @@ bool Plugin::load(color_ostream &con)
plugin_abort_load;
return false;
}
if (strcmp(dfhack_git_desc, *plug_git_description) != 0)
con.printerr("Warning: Plugin %s compiled for DFHack %s, running DFHack %s\n",
*plug_name, *plug_git_description, dfhack_git_desc);
if (plug_git_description)
{
if (strcmp(dfhack_git_desc, *plug_git_description) != 0)
con.printerr("Warning: Plugin %s compiled for DFHack %s, running DFHack %s\n",
*plug_name, *plug_git_description, dfhack_git_desc);
}
else
con.printerr("Warning: Plugin %s missing git information\n", *plug_name);
bool *plug_dev = (bool*)LookupPlugin(plug, "plugin_dev");
if (plug_dev && *plug_dev && getenv("DFHACK_NO_DEV_PLUGINS"))
{