Can't assume CanDo is always there.

BasicPolicy doesn't know how to do fallback, that's driven by the VerbosePolicy. But the VerbosePolicy isn't there if BasicPolicy is trying to use CanDo itself. Just remove the check.
This commit is contained in:
Kistaro Windrider 2023-04-03 21:15:43 -07:00
parent 1eedfb50e8
commit f7bed6c4b9
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -156,11 +156,8 @@ func (b *BasicPolicy) Enact(p *Player) (cardsim.Message, error) {
} }
return b.NothingChanged, nil return b.NothingChanged, nil
} }
if b.Enabled(p) {
return b.Do(p) return b.Do(p)
} }
return nil, ErrOptionNotEnabled
}
// Unenact implements Policy. // Unenact implements Policy.
func (b *BasicPolicy) Unenact(p *Player) error { func (b *BasicPolicy) Unenact(p *Player) error {