1
0

Fixed data length issues

This commit is contained in:
Tiger Wang 2014-03-02 16:28:51 +00:00
parent 124fc8bc66
commit a2fb28dd08
2 changed files with 4 additions and 3 deletions

View File

@ -939,7 +939,7 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e
if (!CheckBlockInteractionsRate()) if (!CheckBlockInteractionsRate())
{ {
Kick("Too many blocks were destroyed per unit time - hacked client?"); Kick("Too many blocks were placed/interacted with per unit time - hacked client?");
return; return;
} }

View File

@ -89,7 +89,8 @@ void cFireworkItem::ParseFromNBT(cFireworkItem & a_FireworkItem, const cParsedNB
if (ExplosionName == "Colors") if (ExplosionName == "Colors")
{ {
int DataLength = a_NBT.GetDataLength(explosiontag); // Divide by four as data length returned in bytes
int DataLength = a_NBT.GetDataLength(explosiontag) / 4;
if (DataLength == 0) if (DataLength == 0)
{ {
continue; continue;
@ -103,7 +104,7 @@ void cFireworkItem::ParseFromNBT(cFireworkItem & a_FireworkItem, const cParsedNB
} }
else if (ExplosionName == "FadeColors") else if (ExplosionName == "FadeColors")
{ {
int DataLength = a_NBT.GetDataLength(explosiontag); int DataLength = a_NBT.GetDataLength(explosiontag) / 4;
if (DataLength == 0) if (DataLength == 0)
{ {
continue; continue;