fix crash when using elem.element on windows

This commit is contained in:
jacob1 2018-09-17 23:03:05 -04:00
parent 7f215a6a17
commit 276098f9db

View File

@ -2399,11 +2399,17 @@ void LuaScriptInterface::LuaGetProperty(lua_State* l, StructProperty property, i
lua_pushinteger(l, *((unsigned char*)propertyAddress));
break;
case StructProperty::BString:
lua_pushstring(l, *((char**)propertyAddress));
{
ByteString byteStringProperty = *((ByteString*)propertyAddress);
lua_pushstring(l, byteStringProperty.c_str());
break;
}
case StructProperty::String:
lua_pushstring(l, (*((String*)propertyAddress)).ToUtf8().c_str());
{
ByteString byteStringProperty = (*((String*)propertyAddress)).ToUtf8();
lua_pushstring(l, byteStringProperty.c_str());
break;
}
case StructProperty::Colour:
#if PIXELSIZE == 4
lua_pushinteger(l, *((unsigned int*)propertyAddress));