EvanatorM / ScuffedMinecraft

A Minecraft Clone in C++
MIT License
140 stars 23 forks source link

fix "Selected Block" text display #20

Closed StillGreen-san closed 3 weeks ago

StillGreen-san commented 3 weeks ago

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