fix #8115 segmentation fault on attack event (berserker) (#8116)

This commit is contained in:
gfgtdf 2023-12-15 21:08:16 +01:00 committed by GitHub
parent 6322ca8bc8
commit 0abed71f75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1207,9 +1207,11 @@ bool attack::perform_hit(bool attacker_turn, statistics_attack_context& stats)
// for that unit, but let the other unit continue
if (attacker_stats->weapon == nullptr){
attacker.n_attacks_ = 0;
attacker.orig_attacks_ = 0;
}
if (defender_stats->weapon == nullptr){
defender.n_attacks_ = 0;
defender.orig_attacks_ = 0;
}
return true;