Fixes potential overflow in script suppression.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2021-11-19 14:09:16 +01:00
parent 9ede453587
commit a78b2e54a4
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 4 additions and 1 deletions

View File

@ -26,7 +26,10 @@ namespace CreatureLib::Battling {
inline ArbUt::OptionalBorrowedPtr<void> GetOwner() const noexcept { return _owner; } inline ArbUt::OptionalBorrowedPtr<void> GetOwner() const noexcept { return _owner; }
inline bool IsSuppressed() const noexcept { return _suppressed > 0; } inline bool IsSuppressed() const noexcept { return _suppressed > 0; }
inline void Suppress() { _suppressed++; } inline void Suppress() { _suppressed++; }
inline void Unsuppress() { _suppressed--; } inline void Unsuppress() {
if (_suppressed > 0)
_suppressed--;
}
virtual ~BattleScript() = default; virtual ~BattleScript() = default;