It is currently 18 Jun 2025, 17:10
   
Text Size

Shandalar - Program Bugs

patron wizard causes game crash (fix completed)

 

Patron Wizard causes game crash upon attempting to cast.
Last edited by Korath on 19 Aug 2015, 11:10, edited 2 times in total.
Reason: Component Individual Card->Duel Engine, version Thieves Hideout 1->Ruined Tower 1

Comments

Posted by Korath » 19 Aug 2015, 11:28

The underlying bug goes all the way back to RT1, though I can't find any cards in that release that can excercise it. In the Loremaster's Tower series, it can be done with either Glare of Subdual or Opposition, by controlling an untapped creature but not having any valid targets (due to shroud or protection).

What's happening is that, when a cost can't be paid or is cancelled, the activation macros call cancel_activation() for each of their already-processed costs, no matter what the underlying event was; it should only do so for EVENT_ACTIVATE. When this is done for EVENT_CAN_ACTIVATE, ActivateTap::cancel_activation() tries to untap the cards that were tapped to pay that cost, but it doesn't have valid data for which cards were tapped (since none have been yet). Hence the crash.

The reason it hadn't turned up yet is that, for all of the costs which do something similar - sacrifice one or more cards of a given type or subtype, or bounce them, or tap them - either this cost is the last one assessed, or the following costs are always true (because the only one that appeared after them was targetting, it was legal to target a player, and players can't have shroud or hexproof yet). The only two exceptions were Glare of Subdual and Opposition in LT, and as seen in the repros above, it's hard to trigger the bug accidentally with them. For Patron Wizard, however, you just need to have an untapped Wizard on the battlefield (the Patron Wizard itself will do) and no targetable spell on the stack (which happens as soon as the Patron Wizard resolves).

Posted by Korath » 19 Aug 2015, 11:36

commit 3b1778c10ea4462ed43fc869cfec83fe4d3350b7
Author: Korath <dgk@Dirge.none>
Date: Wed Aug 19 07:30:32 2015 -0400

[LT] FIX #674: only call Activate*::cancel_activation() for EVENT_ACTIVATE

Ticket details

  • Ticket ID: 674
  • Project: Shandalar
  • Status: Fix completed
  • Component: Duel Engine
  • Project version: Ruined Tower 1
  • Priority: Normal
  • Severity: Normal
  • Assigned to: Korath
  • Reported by: rodil
  • Reporter's tickets: List all tickets
  • Reported on: 09 Aug 2015, 10:42
  • Last visited by Korath » 26 Oct 2015, 08:59.
 

Main Menu

User Menu

Our Partners


Login Form