short circuit when game is finished

This commit is contained in:
ntr 2019-12-18 11:14:35 +10:00
parent 9ce98fe81f
commit 14ddc0b237

View File

@ -495,6 +495,8 @@ impl Game {
} }
fn resolve(&mut self, cast: Cast) -> &mut Game { fn resolve(&mut self, cast: Cast) -> &mut Game {
if self.finished() { return self }
// If the skill is disabled for source nothing else will happen // If the skill is disabled for source nothing else will happen
if let Some(effects) = self.construct(cast.source).disabled(cast.skill) { if let Some(effects) = self.construct(cast.source).disabled(cast.skill) {
self.add_resolution(&cast, &Event::Disable { construct: cast.source, effects }); self.add_resolution(&cast, &Event::Disable { construct: cast.source, effects });