Page 1 of 1

[fixed]Gain control - Equipment unattaches

PostPosted: 05 Feb 2018, 18:22
by Aswan jaguar
Describe the Bug:
I cast Lose Calm and stole Sabertooth Outrider enchanted with Glaring Aegis and equipped with Ghostfire Blade the creature came under my control but Ghostfire Blade became unattached from the creature.

Which card did behave improperly?
Equip mechanism? control mechanism?

Which update are you using? (date, name)Which type? (duel, gauntlet, sealed deck)
Manalink dev 778ccb5 version - duel

What exactly should be the correct behavior/interaction?
The equipment remains on the stolen creature until it's controller equips it to another creature. Notice however in the rules that even if the one that gets the creature is not the controller "if the equipment grants an ability to the equipped creature (with “gains” or “has”), the equipped creature’s controller is the only one who can activate that ability."
Rules:
301.5d An Equipment’s controller is separate from the equipped creature’s controller; the two need not be the same. Changing control of the creature doesn’t change control of the Equipment, and vice versa. Only the Equipment’s controller can activate its abilities. However, if the Equipment grants an ability to the equipped creature (with “gains” or “has”), the equipped creature’s controller is the only one who can activate that ability.

Are any other cards possibly affected by this bug?
-

Re: [confirmed]Gain control - Equipment unattaches

PostPosted: 06 Jan 2022, 09:10
by Aswan jaguar
We did a lot of work on auras and some on equipment since I posted this, this is still a bug.

Re: [confirmed]Gain control - Equipment unattaches

PostPosted: 06 Jan 2022, 18:20
by drool66
Ugh Glaring Aegis fell off too what the heck

Re: [confirmed]Gain control - Equipment unattaches

PostPosted: 06 Jan 2022, 18:39
by Korath
I haven't looked into Ghostfire Blade, but Glaring Aegis detaches because it fails the would_validate_arbitrary_target() test in aura_impl(). I'm guessing you use the same raw target that you do during casting, without ever setting preferred_controller to allowed_controller? If so, this is the same problem we used to see with forced triggers before introducing select_target_maybe_force().

Re: [confirmed]Gain control - Equipment unattaches

PostPosted: 06 Jan 2022, 19:08
by Aswan jaguar
It is not a global aura issue I did donate an aura to test this when testing the equipment and it didn't fell off, also tested Abzan Runemark and Brilliant Halo and they works fine while all 3-4 equipment I tested were bugged.

Re: [confirmed]Gain control - Equipment unattaches

PostPosted: 06 Jan 2022, 19:38
by Korath
Abzan Runemark fell off for me. I didn't try Brilliant Halo.

What's happening with Ghostfire Blade is that targets[8] doesn't get updated when whatever it's attached to changes control, so is_equipping() "helpfully" sets both its fields to -1 when it sees that there's no longer a card there.

The targets[8] hack is an abomination. Get rid of it. card_instance_t has dedicated data for "what is this card attached to", and it's (mis)named damage_target_player/damage_target_card. That is properly updated during change of control, as is targets data that's marked as used by having number_of_targets set.

Re: [confirmed]Gain control - Equipment unattaches

PostPosted: 06 Jan 2022, 21:43
by drool66
I haven't looked into Ghostfire Blade, but Glaring Aegis detaches because it fails the would_validate_arbitrary_target() test in aura_impl(). I'm guessing you use the same raw target that you do during casting, without ever setting preferred_controller to allowed_controller? If so, this is the same problem we used to see with forced triggers before introducing select_target_maybe_force().
It is not a global aura issue I did donate an aura to test this when testing the equipment and it didn't fell off, also tested Abzan Runemark and Brilliant Halo and they works fine while all 3-4 equipment I tested were bugged.
Oh right, I keep forgetting that preferred_controller actually sets targets illegal for AI, rather than changing ai_modifier like I assumed long ago, before I even knew how to check that. Looks like those auras that set preferred_controller have this bug and those that don't, don't. Fixed in dev. I'll work on the juggling between targets[0] and damage_target_player/_card in equipment to exclude targets[8] as soon as I can.

Re: [confirmed]Gain control - Equipment unattaches

PostPosted: 07 Jan 2022, 13:12
by Aswan jaguar
Aswan jaguar wrote:It is not a global aura issue I did donate a creature enchanted with aura to test this when testing the equipment and it didn't fell off, also tested Abzan Runemark and Brilliant Halo and they works fine while all 3-4 equipment I tested were bugged.
Korath wrote:Abzan Runemark fell off for me. I didn't try Brilliant Halo.
Both fell off as Korath says (so maybe it is after all a global issue) if AI has cast the auras on his creatures and then I steal them, no matter if they are equipped or not.
They didn't fell off as I say above when I was the owner and controller of both the creatures and the auras enchanting my creature and then I donated them equipped or not.
In contrast equipment unattaches each time the controller changes.

Re: [confirmed]Gain control - Equipment unattaches

PostPosted: 23 Jan 2022, 16:31
by drool66
Fixed in 44497eb