Fixes HistoryHolder CopyOnto not actually copying memory.
continuous-integration/drone/push Build is passing Details

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
Deukhoofd 2021-04-11 23:10:36 +02:00
parent cd8a29e8fd
commit e2cc20d1c5
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 1 additions and 0 deletions

View File

@ -76,6 +76,7 @@ namespace CreatureLib::Battling {
other._offset = _offset;
other._capacity = _capacity;
other._memory = static_cast<uint8_t*>(malloc(_capacity));
memcpy(other._memory, _memory, _capacity);
if (_top != nullptr) {
other._top = reinterpret_cast<HistoryElement*>(other._memory + ((u8*)_top - _memory));
}