[fixed/closed]Bug in tapping lands
Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins
9 posts
• Page 1 of 1
[fixed/closed]Bug in tapping lands
by 0rion79 » 17 Apr 2014, 15:07
BUG: when cards with special casting cost are cast, like Kangee, Aerie Keeper (kicker) or Court Hussar (white mana variant), the game does no longer auto-tap special lands as Wasteland or Kabira Crossroads, which must be tapped for mana in advance.
Patch: April 2014
mmode: tested in EDH
Patch: April 2014
mmode: tested in EDH
Last edited by BAgate on 26 Jan 2016, 02:10, edited 3 times in total.
Reason: closed
Reason: closed
-
0rion79 - Posts: 1520
- Joined: 24 Feb 2009, 18:33
- Location: Italy
- Has thanked: 94 times
- Been thanked: 61 times
Re: [confirmed]Bug in tapping lands
by BAgate » 18 Apr 2014, 02:02
At least with Wasteland, you can't tap it for mana after the spell has been cast (so if you cast Court Hussar for ex., you choose what type of mana to spend [ex. the kicker is paid] but then when you try to pay the mana Wasteland can not be tapped for mana regardless of if you used autotap or are doing it manually).
Working on: housekeeping and archived reports
Re: [confirmed]Bug in tapping lands
by Korath » 18 Apr 2014, 02:19
I've noticed this, and I'm not sure what causes it.
Or, rather, I know why nothing happens when you click the unhighlit Wasteland, and why that worked in previous versions, and even what broke it: a fix to a more severe bug, which let lands tap for mana even if our response to EVENT_CAN_ACTIVATE says it isn't activateable, and which caused multi-mana lands to tap for one mana instead. (eea7596 is the relevant commit.) What I don't know is why it doesn't get highlit (and didn't in previous versions either).
Highlightedness is stored in card_instance_t::unknown0x70, and is set in reassess_all_cards_helper() at 0x477410. Whether the card is considered activateable doesn't go through that, and is determined in at least two other places; one is sub_476B90() (which doesn't use the same logic as reassess_all_card_helper(), but seems to end up with the same results) and the other is in something called from sub_4378E0(), most likely the SendMessage() call to hwnd_MainWindow (which both uses w32api directly and is multithreaded, either of which would make it very difficult to fully understand even if we had the source).
Now, the thing that all the nonfunctional lands have in common is that they're flagged as having both mana and non-mana abilities (EA_MANA_SOURCE and EA_ACT_ABILITY). There's a function is_mana_source_but_not_act_ability() that checks specifically for this case, called by dispatch_event_to_single_card() and sub_475A30() (the main front-end to the function that chooses a card to activate, whether from an AI decision or from a player clicking on one). If I disable the check of EA_ACT_ABILITY in is_mana_source_but_not_act_ability() - essentially making it return true for every mana source, no matter its other abilities - the lands in question both get highlit and can be activated. There's an experimental patch in branch 14239.
I have no idea what the side effects will be, though, and I'm not thrilled about individually testing every card so flagged (there's 301 of them). Some, like Kabira Crossroads, are misflagged, but I suspect most aren't. And there's a couple of original MicroProse cards like Celestial Prism and Coal Golem and Fire Sprites that are flagged like that which I'd think shouldn't be, which makes me suspect we understand those flags less well than I'd thought.
Or, rather, I know why nothing happens when you click the unhighlit Wasteland, and why that worked in previous versions, and even what broke it: a fix to a more severe bug, which let lands tap for mana even if our response to EVENT_CAN_ACTIVATE says it isn't activateable, and which caused multi-mana lands to tap for one mana instead. (eea7596 is the relevant commit.) What I don't know is why it doesn't get highlit (and didn't in previous versions either).
Highlightedness is stored in card_instance_t::unknown0x70, and is set in reassess_all_cards_helper() at 0x477410. Whether the card is considered activateable doesn't go through that, and is determined in at least two other places; one is sub_476B90() (which doesn't use the same logic as reassess_all_card_helper(), but seems to end up with the same results) and the other is in something called from sub_4378E0(), most likely the SendMessage() call to hwnd_MainWindow (which both uses w32api directly and is multithreaded, either of which would make it very difficult to fully understand even if we had the source).
Now, the thing that all the nonfunctional lands have in common is that they're flagged as having both mana and non-mana abilities (EA_MANA_SOURCE and EA_ACT_ABILITY). There's a function is_mana_source_but_not_act_ability() that checks specifically for this case, called by dispatch_event_to_single_card() and sub_475A30() (the main front-end to the function that chooses a card to activate, whether from an AI decision or from a player clicking on one). If I disable the check of EA_ACT_ABILITY in is_mana_source_but_not_act_ability() - essentially making it return true for every mana source, no matter its other abilities - the lands in question both get highlit and can be activated. There's an experimental patch in branch 14239.
I have no idea what the side effects will be, though, and I'm not thrilled about individually testing every card so flagged (there's 301 of them). Some, like Kabira Crossroads, are misflagged, but I suspect most aren't. And there's a couple of original MicroProse cards like Celestial Prism and Coal Golem and Fire Sprites that are flagged like that which I'd think shouldn't be, which makes me suspect we understand those flags less well than I'd thought.
-
Korath - DEVELOPER
- Posts: 3708
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1108 times
Re: [confirmed]Bug in tapping lands
by HarlequinCasts » 18 Apr 2014, 13:21
I believe this is the same problem, but this is the example I am seeing in the April patch that was not a problem in BNGv2
Cast Chalice of the Void
Try to pay X = 2 using Ancient Tomb
Cannot tap Ancient Tomb
Work around is to tap for the mana first. Like I said this is new as of April patch.
Cast Chalice of the Void
Try to pay X = 2 using Ancient Tomb
Cannot tap Ancient Tomb
Work around is to tap for the mana first. Like I said this is new as of April patch.
-
HarlequinCasts - Posts: 922
- Joined: 07 May 2013, 14:33
- Has thanked: 68 times
- Been thanked: 30 times
Re: [confirmed]Bug in tapping lands
by Korath » 18 Apr 2014, 20:03
Yes, Ancient Tomb is one of the lands affected. It was flagged both EA_MANA_SOURCE and EA_ACT_ABILITY to try to work around the same bug whose fix precipitated this - it kept damage from being dealt in the same circumstances that it only gave one mana. (Related bug, also in need of non-developer assistance.)
Here's an executable version of the experimental patch I mentioned earlier, if anyone cares to look for side effects. You'll want to back up Magic.exe first. If you apply this, please say you've done so in any further bug reports, whether they seem related to this one or not.
Here's an executable version of the experimental patch I mentioned earlier, if anyone cares to look for side effects. You'll want to back up Magic.exe first. If you apply this, please say you've done so in any further bug reports, whether they seem related to this one or not.
- Attachments
-
patch_charge_mana_can_activate.zip
- (15.32 KiB) Downloaded 233 times
-
Korath - DEVELOPER
- Posts: 3708
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1108 times
Re: [confirmed]Bug in tapping lands
by Korath » 29 Apr 2014, 13:27
Haven't had a chance to check cards systematically, but seems to have been working ok. Merged to master in ccc7430.
-
Korath - DEVELOPER
- Posts: 3708
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1108 times
Re: [confirmed]Bug in tapping lands
by Aswan jaguar » 30 Apr 2014, 14:52
What you are trying to change makes these mana producing cards not to be able to be activated on stack and their activation doesn't use the stack.The engine doesn't recognise that there is a card that can be activated at instant/interrupt speed so you can't respond to a Swords of Plowshares targeting your Coal Golem so you can't pay
&sacrifice it to get the
using it's ability.And you can't activate any of these cards on the stack if there isn't any other card that can be cast or activated at instant speed.
As I have told you through pm when I did the work on some mana artifacts,creatures & lands these cards need those values.




As I have told you through pm when I did the work on some mana artifacts,creatures & lands these cards need those values.
---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-
Aswan jaguar - Super Tester Elite
- Posts: 8129
- Joined: 13 May 2010, 12:17
- Has thanked: 748 times
- Been thanked: 477 times
Re: [confirmed]Bug in tapping lands
by Nexhro » 01 May 2014, 21:47
Done.Korath wrote:(Related bug, also in need of non-developer assistance.)
-
Nexhro - Posts: 1613
- Joined: 23 Jan 2014, 18:08
- Location: HRO, UTC +1
- Has thanked: 78 times
- Been thanked: 103 times
Re: [confirmed]Bug in tapping lands
by Korath » 05 Jan 2016, 12:20
This has been fixed for forever, but as of ee91a88 it's done differently.
-
Korath - DEVELOPER
- Posts: 3708
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1108 times
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 23 guests