diff options
author | aunsane <aunsane@gmail.com> | 2017-09-27 22:10:27 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-09-27 22:10:39 +0300 |
commit | daa82a8abe296edc170ceff2f4bac25c67846030 (patch) | |
tree | 59624d431d64cf218f307e9375e50f6cc05b6ce2 /plugins/MirLua/src/mlua_metatable.h | |
parent | 5f97f4c8be447b9c083fb4f37e6093e939bb54e8 (diff) |
MirLua: srmm change metatable to work with table instead of userdata
Diffstat (limited to 'plugins/MirLua/src/mlua_metatable.h')
-rw-r--r-- | plugins/MirLua/src/mlua_metatable.h | 11 |
1 files changed, 4 insertions, 7 deletions
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);
}
};
|