Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix card attributes being set to the wrong card; fix #2332 #2650

Merged
merged 1 commit into from
Apr 29, 2017

Conversation

ctrlaltca
Copy link
Contributor

@ctrlaltca ctrlaltca commented Apr 25, 2017

Related Ticket(s)

Short roundup of the initial problem

If a card changed owner while being put on the table, its attributes could be set on the wrong card.

What will change with this Pull Request?

Fix the problem

I've been able to reproduce a card collision id and check that the attributes are now set to the correct card:

game log
"[Event_SetActivePlayer.ext] { active_player_id: 0 }"
"[Event_SetActivePhase.ext] { phase: 0 }"
OUT 10 "cmd_id: 14 game_id: 69 game_command { [Command_Mulligan.ext] { } }"
IN 195 "message_type: GAME_EVENT_CONTAINER game_event_container { game_id: 69 event_list { player_id: 1 [Event_Shuffle.ext] { } } event_list { player_id: 1 [Event_DrawCards.ext] { number: 7 cards { id: 22 name: \"Urborg, Tomb of Yawgmoth\" } cards { id: 45 name: \"Bloodsoaked Champion\" } cards { id: 8 name: \"Bloodstained Mire\" } cards { id: 18 name: \"Swamp\" } cards { id: 7 name: \"Mana Confluence\" } cards { id: 30 name: \"Chief of the Edge\" } cards { id: 46 name: \"Goblin Rabblemaster\" } } } context { [Context_Mulligan.ext] { number: 4294967295 } } }"
"\x00\x00\x00\b\b\x00\x12\x04\b\x0E\x10\x01"
"player_id: 1 [Event_Shuffle.ext] { }"
"player_id: 1 [Event_DrawCards.ext] { number: 7 cards { id: 22 name: \"Urborg, Tomb of Yawgmoth\" } cards { id: 45 name: \"Bloodsoaked Champion\" } cards { id: 8 name: \"Bloodstained Mire\" } cards { id: 18 name: \"Swamp\" } cards { id: 7 name: \"Mana Confluence\" } cards { id: 30 name: \"Chief of the Edge\" } cards { id: 46 name: \"Goblin Rabblemaster\" } }"
IN 33 "message_type: GAME_EVENT_CONTAINER game_event_container { game_id: 69 event_list { player_id: 0 [Event_Shuffle.ext] { } } event_list { player_id: 0 [Event_DrawCards.ext] { number: 7 } } context { [Context_Mulligan.ext] { number: 4294967295 } } }"
"player_id: 0 [Event_Shuffle.ext] { }"
"player_id: 0 [Event_DrawCards.ext] { number: 7 }"
IN 58 "message_type: GAME_EVENT_CONTAINER game_event_container { game_id: 69 event_list { player_id: 0 [Event_CreateToken.ext] { zone_name: \"table\" card_id: 75 card_name: \"Arlinn Kord (emblem)\" color: \"\\000\" pt: \"\" annotation: \"\" destroy_on_zone_change: true x: 0 y: 1 } } }"
"player_id: 0 [Event_CreateToken.ext] { zone_name: \"table\" card_id: 75 card_name: \"Arlinn Kord (emblem)\" color: \"\\000\" pt: \"\" annotation: \"\" destroy_on_zone_change: true x: 0 y: 1 }"
IN 68 "message_type: GAME_EVENT_CONTAINER game_event_container { game_id: 69 event_list { player_id: 0 [Event_MoveCard.ext] { card_id: 6 card_name: \"Goblin Rabblemaster\" start_player_id: 0 start_zone: \"hand\" position: 5 target_player_id: 0 target_zone: \"stack\" x: 0 y: 0 new_card_id: 6 face_down: false } } context { [Context_MoveCard.ext] { } } }"
"player_id: 0 [Event_MoveCard.ext] { card_id: 6 card_name: \"Goblin Rabblemaster\" start_player_id: 0 start_zone: \"hand\" position: 5 target_player_id: 0 target_zone: \"stack\" x: 0 y: 0 new_card_id: 6 face_down: false }"
QString::arg: Argument missing: "gino plays <i><a href=\"card://Goblin Rabblemaster\">Goblin Rabblemaster</a></i> from their hand." , 0
IN 94 "message_type: GAME_EVENT_CONTAINER game_event_container { game_id: 69 event_list { player_id: 0 [Event_MoveCard.ext] { card_id: 6 card_name: \"Goblin Rabblemaster\" start_player_id: 0 start_zone: \"stack\" position: -1 target_player_id: 1 target_zone: \"table\" x: 0 y: 0 new_card_id: 75 face_down: false } } event_list { player_id: 1 [Event_SetCardAttr.ext] { zone_name: \"table\" card_id: 75 attribute: AttrPT attr_value: \"2/2\" } } context { [Context_MoveCard.ext] { } } }"
"player_id: 0 [Event_MoveCard.ext] { card_id: 6 card_name: \"Goblin Rabblemaster\" start_player_id: 0 start_zone: \"stack\" position: -1 target_player_id: 1 target_zone: \"table\" x: 0 y: 0 new_card_id: 75 face_down: false }"
"player_id: 1 [Event_SetCardAttr.ext] { zone_name: \"table\" card_id: 75 attribute: AttrPT attr_value: \"2/2\" }"

I've created a "Arlinn Kord (emblem)" token with card_id = 75
Then, put a "Goblin Rabblemaster" on the stack, card_id = 6
Then moved the goblin from the stack to the opponent's table; the goblin received a new card id of 75, colliding with the token
The 2/2 PT has been assigned correctly to the Goblin (player_id: 1, zone_name: table, card_id: 75) instead of the token (player_id: 0, zone_name: table, card_id: 75)

Note: this is a server side change

@ZeldaZach
Copy link
Member

I'm not really certain how to test something like this other then to roll it in and see what happens...

Copy link
Member

@ZeldaZach ZeldaZach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to go forward with this and we'll get feedback from beta testers

@ctrlaltca ctrlaltca merged commit b20c60e into Cockatrice:master Apr 29, 2017
@ctrlaltca ctrlaltca deleted the fix_2332 branch April 29, 2017 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants