diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/intercopycontext.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/intercopycontext.cpp b/src/intercopycontext.cpp index 0ccd619..4be1883 100644 --- a/src/intercopycontext.cpp +++ b/src/intercopycontext.cpp | |||
| @@ -494,8 +494,12 @@ void InterCopyContext::interCopyKeyValuePair() const | |||
| 494 | *std::format_to(_valPath, "{}[U:{}]", name, _key) = 0; | 494 | *std::format_to(_valPath, "{}[U:{}]", name, _key) = 0; |
| 495 | } else if (luaW_type(L1, _key_i) == LuaType::BOOLEAN) { | 495 | } else if (luaW_type(L1, _key_i) == LuaType::BOOLEAN) { |
| 496 | int const _key{ lua_toboolean(L1, _key_i) }; | 496 | int const _key{ lua_toboolean(L1, _key_i) }; |
| 497 | _valPath = static_cast<char*>(alloca(name.size() + 8)); // +8 for [], 'false' and terminating 0 | 497 | _valPath = static_cast<char*>(alloca(name.size() + 8)); // +8 for [false] and terminating 0 |
| 498 | *std::format_to(_valPath, "{}[{}]", name, _key ? "true" : "false") = 0; | 498 | *std::format_to(_valPath, "{}[{}]", name, _key ? "true" : "false") = 0; |
| 499 | } else if (luaW_type(L1, _key_i) == LuaType::USERDATA) { | ||
| 500 | // I don't want to invoke tostring on the userdata to get its name | ||
| 501 | _valPath = static_cast<char*>(alloca(name.size() + 11)); // +11 for [U:<FULL>] and terminating 0 | ||
| 502 | *std::format_to(_valPath, "{}[U:<FULL>]", name) = 0; | ||
| 499 | } | 503 | } |
| 500 | } | 504 | } |
| 501 | 505 | ||
