Skip to content

Commit

Permalink
fix: correct LevelSetting size for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed May 26, 2024
1 parent 6101f5d commit 54cd471
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions include/bedrock/network/protocol/game/start_game_packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class StartGamePacket : public Packet {

private:
mutable LevelSettings settings_; // +48
ActorUniqueID entity_id_; // +1296
ActorRuntimeID runtime_id_; // +1304
GameType game_type_; // +1312
ActorUniqueID entity_id_; // +1296 (+1072)
ActorRuntimeID runtime_id_; // +1304 (+1080)
GameType game_type_; // +1312 (+1088)
Vec3 position_; // +1316
Vec2 rotation_; // +1328
std::string level_id_; // +1336
Expand All @@ -61,8 +61,8 @@ class StartGamePacket : public Packet {
std::string server_version_; // +1536
CompoundTag player_property_data_; // +1568
std::uint64_t server_block_type_registry_checksum_; // +1592
bool server_enabled_client_side_generation_; // +1600
bool block_network_ids_are_hashes_; // +1601
NetworkPermissions network_permissions_; // +1602
std::vector<std::pair<std::string, CompoundTag>> block_properties_; // +1608
bool server_enabled_client_side_generation_; // +1600 (+1352)
bool block_network_ids_are_hashes_; // +1601 (+1353)
NetworkPermissions network_permissions_; // +1602 (+1354)
std::vector<std::pair<std::string, CompoundTag>> block_properties_; // +1608 (+1360)
};
6 changes: 3 additions & 3 deletions include/bedrock/world/level/storage/level_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ class LevelSettings {

void setRandomSeed(LevelSeed64 seed)
{
seed_ = std::move(seed);
seed_ = seed;
}

private:
LevelSeed64 seed_;
#ifdef _WIN32
size_t pad_[1248 / 8 - 1];
#else
size_t pad_[1072 / 8 - 1];
size_t pad_[1024 / 8 - 1];
#endif
};
BEDROCK_STATIC_ASSERT_SIZE(LevelSettings, 1248, 1072);
BEDROCK_STATIC_ASSERT_SIZE(LevelSettings, 1248, 1024);

0 comments on commit 54cd471

Please sign in to comment.