diff options
Diffstat (limited to 'plugins/MirLua/src')
-rw-r--r-- | plugins/MirLua/src/m_core.cpp | 8 | ||||
-rw-r--r-- | plugins/MirLua/src/m_genmenu.cpp | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp index 698eacffa3..48e54dd8c6 100644 --- a/plugins/MirLua/src/m_core.cpp +++ b/plugins/MirLua/src/m_core.cpp @@ -179,15 +179,13 @@ static int lua_CallService(lua_State *L) static int lua_IsPluginLoaded(lua_State *L)
{
- const char *value = luaL_checkstring(L, 1);
+ const char *value = lua_tostring(L, 1);
MUUID uuid = { 0 };
int res = sscanf_s(value, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
- &uuid.a, &uuid.b, &uuid.c, &uuid.d[0], &uuid.d[1], &uuid.d[2], &uuid.d[3], &uuid.d[4], &uuid.d[5], &uuid.d[6], &uuid.d[7]);
- if (res == 11)
- {
+ &uuid.a, &uuid.b, &uuid.c, &uuid.d[0], &uuid.d[1], &uuid.d[2], &uuid.d[3], &uuid.d[4], &uuid.d[5], &uuid.d[6], &uuid.d[7]) == 11;
+ if (res == TRUE)
res = ::IsPluginLoaded(uuid);
- }
lua_pushboolean(L, res);
return 1;
diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp index c8f57691f9..ddc04b5549 100644 --- a/plugins/MirLua/src/m_genmenu.cpp +++ b/plugins/MirLua/src/m_genmenu.cpp @@ -21,7 +21,7 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi) unsigned short b, c;
unsigned char d[8];
if (sscanf_s(uuid, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
- &a, &b, &c, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7]) == 11)
+ &mi.uid.a, &mi.uid.b, &mi.uid.c, &mi.uid.d[0], &mi.uid.d[1], &mi.uid.d[2], &mi.uid.d[3], &mi.uid.d[4], &mi.uid.d[5], &mi.uid.d[6], &mi.uid.d[7]) == 11)
SET_UID(mi, a, b, c, d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7]);
}
lua_pop(L, 1);
|