mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Fix counter-attack counting
This commit is contained in:
@@ -359,6 +359,8 @@ CUnitState & CUnitState::operator=(const CUnitState & other)
|
|||||||
waiting = other.waiting;
|
waiting = other.waiting;
|
||||||
waitedThisTurn = other.waitedThisTurn;
|
waitedThisTurn = other.waitedThisTurn;
|
||||||
casts = other.casts;
|
casts = other.casts;
|
||||||
|
counterAttacks = other.counterAttacks;
|
||||||
|
shots = other.shots;
|
||||||
health = other.health;
|
health = other.health;
|
||||||
cloneID = other.cloneID;
|
cloneID = other.cloneID;
|
||||||
position = other.position;
|
position = other.position;
|
||||||
|
|||||||
@@ -34,6 +34,19 @@ protected:
|
|||||||
{
|
{
|
||||||
std::atomic<int64_t> version = 0;
|
std::atomic<int64_t> version = 0;
|
||||||
std::atomic<int64_t> value = 0;
|
std::atomic<int64_t> value = 0;
|
||||||
|
|
||||||
|
BonusCacheEntry() = default;
|
||||||
|
BonusCacheEntry(const BonusCacheEntry & other)
|
||||||
|
: version(other.version.load())
|
||||||
|
, value(other.value.load())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
BonusCacheEntry & operator =(const BonusCacheEntry & other)
|
||||||
|
{
|
||||||
|
version = other.version.load();
|
||||||
|
value = other.value.load();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int getBonusValueImpl(BonusCacheEntry & currentValue, const CSelector & selector, BonusCacheMode) const;
|
int getBonusValueImpl(BonusCacheEntry & currentValue, const CSelector & selector, BonusCacheMode) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user