diff --git a/Source/msg.cpp b/Source/msg.cpp index bd98a5066..b237f3cb8 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -233,8 +233,10 @@ struct DSpawnedMonster { int16_t golemSpellLevel; }; +constexpr int MaxDeltaItems = MAXITEMS * 2; + struct DLevel { - TCmdPItem item[MAXITEMS]; + TCmdPItem item[MaxDeltaItems]; ankerl::unordered_dense::map object; ankerl::unordered_dense::map spawnedMonsters; DMonsterStr monster[MaxMonsters]; @@ -531,7 +533,7 @@ int WaitForTurns() std::byte *DeltaExportItem(std::byte *dst, const TCmdPItem *src) { - for (int i = 0; i < MAXITEMS; i++, src++) { + for (int i = 0; i < MaxDeltaItems; i++, src++) { if (src->bCmd == CMD_INVALID) { *dst++ = std::byte { 0xFF }; } else { @@ -546,7 +548,7 @@ std::byte *DeltaExportItem(std::byte *dst, const TCmdPItem *src) const std::byte *DeltaImportItem(const std::byte *src, const std::byte *end, TCmdPItem *dst) { size_t size = 0; - for (int i = 0; i < MAXITEMS; i++, dst++) { + for (int i = 0; i < MaxDeltaItems; i++, dst++) { if (&src[size] >= end) return nullptr; if (src[size] == std::byte { 0xFF }) { diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 912eb495e..ab59ffcc5 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bug Fixes +#### Multiplayer + +- Potential item deletion when dropping a large amount of items and leaving the level + #### Graphics / Audio - Music doesn't unmute when focus is lost on level transition with Auto Pause On Focus Lost disabled