From ba5e937dbdc6f7a33f1aa664576d8edf1e0ff82f Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 11 Apr 2021 23:29:00 +0200 Subject: [PATCH] Remove copying historyholder for now, as it causes issues. Signed-off-by: Deukhoofd --- src/Battling/History/HistoryHolder.hpp | 14 -------------- src/Battling/Models/Battle.cpp | 1 - 2 files changed, 15 deletions(-) diff --git a/src/Battling/History/HistoryHolder.hpp b/src/Battling/History/HistoryHolder.hpp index 105df5a..59146c4 100644 --- a/src/Battling/History/HistoryHolder.hpp +++ b/src/Battling/History/HistoryHolder.hpp @@ -67,20 +67,6 @@ namespace CreatureLib::Battling { } return {}; } - - void CloneOnto(HistoryHolder& other) const { - if (other._top != nullptr) { - other._top->Clear(); - } - free(other._memory); - other._offset = _offset; - other._capacity = _capacity; - other._memory = static_cast(malloc(_capacity)); - memcpy(other._memory, _memory, _capacity); - if (_top != nullptr) { - other._top = reinterpret_cast(other._memory + ((u8*)_top - _memory)); - } - } }; } diff --git a/src/Battling/Models/Battle.cpp b/src/Battling/Models/Battle.cpp index 4133be2..ce2d1c3 100644 --- a/src/Battling/Models/Battle.cpp +++ b/src/Battling/Models/Battle.cpp @@ -204,7 +204,6 @@ Battle* Battle::Clone() const { battle->_random = _random; battle->_hasEnded = _hasEnded; battle->_battleResult = _battleResult; - _historyHolder.CloneOnto(battle->_historyHolder); battle->_currentTurn = _currentTurn; _volatile.Clone(battle->_volatile);