Page 2 of 2

Re: Making scripts multiplayer compatible

PostPosted: 23 Oct 2012, 21:42
by Max mtg
Hellfish wrote:
Max mtg wrote:Was it a multiplayer game? I'll have a look
Yeah, the Archenemy demo.
Hope, 17687 solves the problem

Re: Making scripts multiplayer compatible

PostPosted: 23 Oct 2012, 22:01
by Max mtg
TriggerHandler:352 - is there an error?
Code: Select all
if (!playerAP.equals(card.getController()) && !allCards.contains(card)
Should there be nap instead of "ap"?

Re: Making scripts multiplayer compatible

PostPosted: 24 Oct 2012, 05:33
by Sloth
Max mtg wrote:
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 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.
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.
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.
If the comprehensive rules are hacky, we just can't translate this into clean code.