This was a cleanup function to handle converting saves between Hellfire <-> Diablo, mainly when a hellfire specific item was dropped and should be removed from a Diablo game. This had an off by one with the way it iterated backwards over the active items list which meant it always called DeleteItem at least once (since it uses an invalid item past the end of the active items range). DeleteItem then always decremented the ActiveItems count. When saving the game after converting the items we then end up with a dropped items array containing an index to an item that is no longer considered active.
However the code in LoadDroppedItems already checks that the conversion was successful before considering it active, so this function doesn't need to be called. Instead we can just save if we converted game mode.
This fixes a problem related to shrines. When a player with a base Magic or Vitality stat of 0 has their respective stat reduced below 0, they lose Mana/Life, and their stat is corrected to 0 without refunding them the lost Mana/Life. This will prevent stats from being modified to a value less than 0 in the first place.
Previously, the memory for each frame was allocated separately.
Changes it to allocate a single buffer for all the frames.
This has the following advantages:
1. Less bookkeeping overhead in the allocator.
2. Less alignment overhead (allocator results are max-aligned by default).
We can follow this up with a similar treatment for other multi-file
animations.
This allows the item to appear in the delta sync when a new player joins the game, but does not cause the item to drop for other players on the same level at the time the action occurs due to differences in the way this message is handled.
This doesn't handle failed allocations (e.g. if the platform runs out of memory) but makes it easier to use a fixed size container on limited memory devices.