Overhaul memory model to new Arbutils memory.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
@@ -51,14 +51,14 @@ namespace CreatureLib::Battling {
|
||||
|
||||
ArbUt::BorrowedPtr<const HistoryElement> GetTopElement() const noexcept { return _top; }
|
||||
|
||||
ArbUt::BorrowedPtr<const HistoryElement> GetLastUsedAttack() const noexcept {
|
||||
std::optional<ArbUt::BorrowedPtr<const HistoryElement>> GetLastUsedAttack() const noexcept {
|
||||
const auto* c = _top;
|
||||
while (c != nullptr) {
|
||||
if (c->GetKind() == HistoryElementKind::AttackUse)
|
||||
return c;
|
||||
c = c->_previous;
|
||||
}
|
||||
return nullptr;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user