fix: SIOF crash in ChatScreen/TextEditScreen, RemoveEntitiesPacket MAX_PER_PACKET on linux

This commit is contained in:
JuiceyDev 2026-03-05 07:57:25 +01:00
parent 3a9af73c63
commit d0e7106cdf
5 changed files with 5 additions and 6 deletions

View file

@ -4,7 +4,7 @@
#include "../../../Minecraft.World/Util/SharedConstants.h"
#include "../../../Minecraft.World/Util/StringHelpers.h"
const wstring ChatScreen::allowedChars = SharedConstants::acceptableLetters;
const wstring ChatScreen::allowedChars = SharedConstants::readAcceptableChars();
ChatScreen::ChatScreen()
{

View file

@ -11,7 +11,7 @@
#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h"
const wstring TextEditScreen::allowedChars = SharedConstants::acceptableLetters;;
const wstring TextEditScreen::allowedChars = SharedConstants::readAcceptableChars();
TextEditScreen::TextEditScreen(shared_ptr<SignTileEntity> sign)
{

View file

@ -51,6 +51,6 @@ int RemoveEntitiesPacket::getEstimatedSize()
4J: These are necesary on the PS3.
(and 4).
*/
#if (defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
#if (defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ || defined __linux__)
const int RemoveEntitiesPacket::MAX_PER_PACKET;
#endif

View file

@ -37,7 +37,7 @@ bool SharedConstants::isAllowedChatCharacter(char ch)
return true;
}
wstring SharedConstants::acceptableLetters;
wstring SharedConstants::acceptableLetters = SharedConstants::readAcceptableChars();
void SharedConstants::staticCtor()
{

View file

@ -14,8 +14,7 @@ class SharedConstants
static const int WORLD_RESOLUTION = 16;
static bool isAllowedChatCharacter(char ch);
private:
// why private??????????
static wstring readAcceptableChars();
public: