Skip to content

Commit

Permalink
Added fix for many crashes related to uncleared initiative list
Browse files Browse the repository at this point in the history
  • Loading branch information
DMD authored and DMD committed Jan 27, 2018
1 parent ef8b9d6 commit fb4e563
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions TemplePlus/gamesystems/legacysystems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "infrastructure/mesparser.h"
#include "legacymapsystems.h"
#include "infrastructure/meshes.h"
#include "turn_based.h"


//*****************************************************************************
Expand Down Expand Up @@ -172,6 +173,8 @@ void TeleportSystem::AdvanceTime(uint32_t time) {
auto &teleportProcessActive = temple::GetRef<BOOL>(0x10AB74B8);
teleportProcessActive = 1;

tbSys.groupInitiativeList->Clear(); // fix for common crash - sometimes initiative list isn't cleared and then some other processes get invalid crap

auto teleportProcess = temple::GetRef<void(__cdecl)(FadeAndTeleportArgs&)>(0x10085AA0);
auto &teleportPacket = temple::GetRef<FadeAndTeleportArgs>(0x10AB74C8);
teleportProcess(teleportPacket);
Expand Down

0 comments on commit fb4e563

Please sign in to comment.