Skip to content

Commit 45e8271

Browse files
author
abstrct
committed
Fixed bug that allowed for offline structs to still counter-attack. Zombies and sleepers causing chaos.
1 parent ac94658 commit 45e8271

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

x/structs/keeper/struct_cache.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,11 @@ func (cache *StructCache) CanAttack(targetStruct *StructCache, weaponSystem type
633633

634634
func (cache *StructCache) CanCounterAttack(attackerStruct *StructCache) (err error) {
635635

636+
readinessError := cache.ReadinessCheck()
637+
if readinessError != nil {
638+
return readinessError
639+
}
640+
636641
if attackerStruct.IsDestroyed() || cache.IsDestroyed() {
637642
cache.CC.k.logger.Info("Counter Struct or Attacker Struct is already destroyed", "counterStruct", cache.StructId, "target", attackerStruct.StructId)
638643
err = types.NewCombatTargetingError(cache.StructId, attackerStruct.StructId, "counter", "destroyed").AsCounter()

0 commit comments

Comments
 (0)