From daa82a8abe296edc170ceff2f4bac25c67846030 Mon Sep 17 00:00:00 2001 From: aunsane Date: Wed, 27 Sep 2017 22:10:27 +0300 Subject: MirLua: srmm change metatable to work with table instead of userdata --- plugins/MirLua/src/mlua_metatable.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'plugins/MirLua/src/mlua_metatable.h') diff --git a/plugins/MirLua/src/mlua_metatable.h b/plugins/MirLua/src/mlua_metatable.h index b3aead3f71..6b4f916668 100644 --- a/plugins/MirLua/src/mlua_metatable.h +++ b/plugins/MirLua/src/mlua_metatable.h @@ -54,7 +54,7 @@ public: virtual MTValue GetValue(void *obj) { - MTValue value = { 0 }; + MTValue value = { }; memcpy(&value, ((char*)obj + offset), sizeof(R)); return value; } @@ -70,7 +70,7 @@ public: virtual MTValue GetValue(void*) { - MTValue value = { 0 }; + MTValue value = { }; value.function = function; return value; } @@ -86,11 +86,8 @@ public: CMTFieldLambda(const char *name, int type, decltype(lambda) lambda) : CMTField(name, type), lambda(lambda), type(type) {} - virtual MTValue GetValue(void *obj) - { - CMTValue result = { type }; - result.Value = lambda((Obj*)obj); - return result; + virtual MTValue GetValue(void *obj) { + return lambda((Obj*)obj); } }; -- cgit v1.2.3