Re: Making scripts multiplayer compatible
Hope, 17687 solves the problemHellfish wrote:Yeah, the Archenemy demo.Max mtg wrote:Was it a multiplayer game? I'll have a look
High Quality Resources for Collectible Card Games and Home of the CCGHQ Team
https://www.slightlymagic.net/forum/
https://www.slightlymagic.net/forum/viewtopic.php?f=52&t=8402
Hope, 17687 solves the problemHellfish wrote:Yeah, the Archenemy demo.Max mtg wrote:Was it a multiplayer game? I'll have a look
if (!playerAP.equals(card.getController()) && !allCards.contains(card)The changes to the canAtack function should be ok, but please stop reverting getDefendingPlayerRelatedTo. Your version only works for Auras, Equipments and creatures that are attacking, but this function has to work for any source.Max mtg wrote:I have read the code for a second time and found out that combat variable is never null, otherwise there would have been an exception thrown at the very first line. So that default assignment was overwritten anyway.Sloth wrote:In order not to break anything, this function has to return a player, so i've chosen what works in a single player game. The code below will switch to the right player in 90% of the cases.
Feel free to fully implement Rule 802.2a which sucks big time, but there are much more pressing matters regarding multiplayer.
I have commited an edition where there is no check for combat == null and defender player is calculated from the entity under attack. See lines 814-815 of http://svn.slightlymagic.net/websvn/dif ... &peg=17683
Was just upset to see player.getOpponent outside of AI code.