fix: various crashes

This commit is contained in:
Fireblade committed 2026-06-30 01:54:08 -04:00
1 parent 312826de24
commit c1f2096ea6
4 files changed
+24 -9

No files matched your search

+10 -5
View File
@@ -20,12 +20,17 @@ void TimeCommand::execute(shared_ptr<CommandSender> source, byteArray commandDat
ByteArrayInputStream bais(commandData);
DataInputStream dis(&bais);
bool night = dis.readBoolean();
bais.reset();
int amount = 0;
if(night) amount = 12500;
if (commandData.length >= sizeof(int))
{
amount = dis.readInt();
}
else
{
bool night = dis.readBoolean();
amount = night ? 12500 : 0;
}
doSetTime(source, amount);
//logAdminAction(source, "commands.time.set", amount);
logAdminAction(source, ChatPacket::e_ChatCustom, L"commands.time.set");