fix "Selected Block" text display #20

Merged
StillGreen-san merged 1 commits from fix-selected-block-text into main 2024-11-02 16:09:55 +00:00
StillGreen-san commented 2024-11-02 10:45:21 +00:00 (Migrated from github.com)

this fixes a bug in the "Selected Block" display where instead of the expected char* the std::string was passed to ImGui::Text
also changes Tall Grass Bot to Tall Grass Bottom since that is working correctly now

the reason this could still work in some situations (for me in release but not debug) is that std::string uses "small string optimization" where small strings are stored in the object itself instead of being allocated elsewhere. if the layout of std::string happens to align in such a way that it could be interpreted like a char[] it will work, but only for small strings

this fixes a bug in the `"Selected Block"` display where instead of the expected `char*` the `std::string` was passed to `ImGui::Text` _also changes `Tall Grass Bot` to `Tall Grass Bottom` since that is working correctly now_ the reason this could still work in some situations _(for me in release but not debug)_ is that `std::string` uses "small string optimization" where small strings are stored in the object itself instead of being allocated elsewhere. if the layout of `std::string` happens to align in such a way that it could be interpreted like a `char[]` it will work, but only for small strings
Sign in to join this conversation.
No description provided.