mirror of
https://github.com/rehlds/metamod-r.git
synced 2025-01-27 14:08:23 +03:00
Fix parse
This commit is contained in:
parent
e1e1b8aaaa
commit
98fd23afed
@ -193,7 +193,6 @@ MPlugin* MPluginList::plugin_addload(plid_t plid, const char* fname, PLUG_LOADTI
|
|||||||
MPlugin* MPluginList::add(MPlugin* padd)
|
MPlugin* MPluginList::add(MPlugin* padd)
|
||||||
{
|
{
|
||||||
auto plug = new MPlugin();
|
auto plug = new MPlugin();
|
||||||
memset(plug, 0, sizeof(MPlugin));
|
|
||||||
|
|
||||||
plug->m_index = ++m_last_index;
|
plug->m_index = ++m_last_index;
|
||||||
|
|
||||||
@ -323,12 +322,25 @@ bool MPluginList::ini_refresh()
|
|||||||
if ((cp = Q_strrchr(line, '\n')))
|
if ((cp = Q_strrchr(line, '\n')))
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
|
|
||||||
|
trimbuf(line);
|
||||||
|
|
||||||
|
// skip empty lines
|
||||||
|
if (line[0] == '\0') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// skip comments
|
||||||
|
if (line[0] == '#' || line[0] == ';' || !Q_strncmp(line, "//", 2)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Parse into a temp plugin
|
// Parse into a temp plugin
|
||||||
MPlugin pl_temp = {};
|
MPlugin pl_temp{};
|
||||||
if (!pl_temp.ini_parseline(line)) {
|
if (!pl_temp.ini_parseline(line)) {
|
||||||
META_ERROR("ini: Skipping malformed line %d of %s", ln, m_inifile);
|
META_ERROR("ini: Skipping malformed line %d of %s", ln, m_inifile);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to find plugin with this pathname in the current list of
|
// Try to find plugin with this pathname in the current list of
|
||||||
// plugins.
|
// plugins.
|
||||||
auto pl_found = find(pl_temp.m_pathname);
|
auto pl_found = find(pl_temp.m_pathname);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user