How can I change the result of an attack/transfer?
In my case, I'm looking to make result.IsSuccessful change from false to true to permit multi-transfer through one's own territories, but the built in code automatically sets it so once you transfer back to territory you already own, all further movement ends up with result.IsSuccessful==false, and my code receives this order as a failed order (result.IsSuccessful==false).
In particular, for when the 1st movement after transferring to one's own territory happens, the following state applies:
*game.ServerGame.LatestTurnStanding.Territories[order.From].NumArmies.NumArmies==# armies present on source territory
*game.ServerGame.LatestTurnStanding.Territories[order.To].NumArmies.NumArmies==# armies present on target territory (owned by same player as source territory)
*order.NumArmies.NumArmies==# of armies the player actually selected to move from source territory to the target territory
*result.ActualArmies.NumArmies==0 --> this is a problem, b/c it's decided that despite the user trying to move units, it's reduced the # that actually move to 0
*result.IsSuccessful==false --> also a problem, and likely the reason why the ActualArmies is set to 0
I've tried skipping this order and adding another order with the figures I need to occur, but the same rules apply and the same result happens again.
IsSuccessful seems to a read only variable, so I can't just change it and force the movement to be allowed.
The problem is that by the time the Order comes to my code, it's already assigned result.IsSuccessful==false and result.ActualArmies.NumArmies==0 and I can't seem to change the result to allow the move to happen.
My code is in:
function Server_AdvanceTurn_Order(game, order, result, skipThisOrder, addNewOrder)
Is this the right spot for it?