summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_genmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/src/m_genmenu.cpp')
-rw-r--r--plugins/MirLua/src/m_genmenu.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp
index 09b64bbc65..1c729c43c9 100644
--- a/plugins/MirLua/src/m_genmenu.cpp
+++ b/plugins/MirLua/src/m_genmenu.cpp
@@ -15,15 +15,8 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi)
lua_pushliteral(L, "Uid");
lua_gettable(L, -2);
const char* uuid = (char*)lua_tostring(L, -1);
- if (uuid)
- {
- unsigned long a;
- unsigned short b, c;
- unsigned char d[8];
- if (sscanf_s(uuid, "{%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX}",
- &a, &b, &c, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &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]);
- }
+ if (CLSIDFromString((LPCOLESTR)ptrT(mir_utf8decodeT(uuid)), (LPCLSID)&mi.uid) != NOERROR)
+ UNSET_UID(mi);
lua_pop(L, 1);
lua_pushliteral(L, "Name");