diff --git a/packages/communication/src/messages/parser/room/unit/RoomUnitInfoParser.ts b/packages/communication/src/messages/parser/room/unit/RoomUnitInfoParser.ts index 8abdcf5..bc11063 100644 --- a/packages/communication/src/messages/parser/room/unit/RoomUnitInfoParser.ts +++ b/packages/communication/src/messages/parser/room/unit/RoomUnitInfoParser.ts @@ -40,7 +40,7 @@ export class RoomUnitInfoParser implements IMessageParser this._standId = wrapper.readInt(); this._overlayId = wrapper.readInt(); - if(wrapper.bytesAvailable >= 4) this._cardBackgroundId = wrapper.readInt(); + if(wrapper.bytesAvailable) this._cardBackgroundId = wrapper.readInt(); return true; } diff --git a/packages/communication/src/messages/parser/user/data/UserProfileParser.ts b/packages/communication/src/messages/parser/user/data/UserProfileParser.ts index da2d53d..4fd679b 100644 --- a/packages/communication/src/messages/parser/user/data/UserProfileParser.ts +++ b/packages/communication/src/messages/parser/user/data/UserProfileParser.ts @@ -74,7 +74,7 @@ export class UserProfileParser implements IMessageParser this._standId = wrapper.readInt(); this._overlayId = wrapper.readInt(); - if(wrapper.bytesAvailable >= 4) this._cardBackgroundId = wrapper.readInt(); + if(wrapper.bytesAvailable) this._cardBackgroundId = wrapper.readInt(); } return true;