Skip to content

Commit

Permalink
Fix Low Carryover
Browse files Browse the repository at this point in the history
http://gna.org/bugs/?23674

We don't want to use the units and gold stored in the global variables if we already get them from normal carryover becasue that results in having them twice.
  • Loading branch information
gfgtdf authored and irydacea committed Nov 27, 2015
1 parent bb87a30 commit 8a04442
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg
Expand Up @@ -249,6 +249,15 @@ Dwarvish Fighter, Dwarvish Thunderer, Dwarvish Scout, Dwarvish Guardsman#enddef

##### Persistent Global Variable macros for multiplayer mode #####

#define IF_FIRST_SCENARIO CODE
[if]
{VARIABLE_CONDITIONAL "side_number" equals ""}
[then]
{CODE}
[/then]
[/if]
#enddef

#define LOAD_PERSISTENT_IF_LOCAL_EMPTY SIDE NAMESPACE GLOBAL_VAR LOCAL_VAR
[if]
{VARIABLE_CONDITIONAL ({LOCAL_VAR}.length) equals 0}
Expand Down Expand Up @@ -313,36 +322,48 @@ Dwarvish Fighter, Dwarvish Thunderer, Dwarvish Scout, Dwarvish Guardsman#enddef

#define GET_PERSISTENT_RECALLS_FROM2 SIDE1 SIDE2 NAMESPACE GLOBAL_VAR
#Loads the recall list variable from both sides.
{LOAD_PERSISTENT_2PLAYER {SIDE1} {SIDE2} {NAMESPACE} {GLOBAL_VAR} party_store}
{UNSTORE_PARTY {SIDE1} }
{IF_FIRST_SCENARIO (
{LOAD_PERSISTENT_2PLAYER {SIDE1} {SIDE2} {NAMESPACE} {GLOBAL_VAR} party_store}
{UNSTORE_PARTY {SIDE1} }
)}
#enddef

#define GET_PERSISTENT_RECALLS_FROM3 SIDE1 SIDE2 SIDE3 NAMESPACE GLOBAL_VAR
#Loads the recall list variable from three sides.
{LOAD_PERSISTENT_3PLAYER {SIDE1} {SIDE2} {SIDE3} {NAMESPACE} {GLOBAL_VAR} party_store}
{UNSTORE_PARTY {SIDE1} }
{IF_FIRST_SCENARIO (
{LOAD_PERSISTENT_3PLAYER {SIDE1} {SIDE2} {SIDE3} {NAMESPACE} {GLOBAL_VAR} party_store}
{UNSTORE_PARTY {SIDE1} }
)}
#enddef

#define GET_PERSISTENT_RECALLS_FROM4 SIDE1 SIDE2 SIDE3 SIDE4 NAMESPACE GLOBAL_VAR
#Loads the recall list variable from four sides.
{LOAD_PERSISTENT_4PLAYER {SIDE1} {SIDE2} {SIDE3} {SIDE4} {NAMESPACE} {GLOBAL_VAR} party_store}
{UNSTORE_PARTY {SIDE1} }
{IF_FIRST_SCENARIO (
{LOAD_PERSISTENT_4PLAYER {SIDE1} {SIDE2} {SIDE3} {SIDE4} {NAMESPACE} {GLOBAL_VAR} party_store}
{UNSTORE_PARTY {SIDE1} }
)}
#enddef

#define GET_PERSISTENT_GOLD_FROM2 SIDE1 SIDE2 NAMESPACE GLOBAL_VAR
#Loads the recall list variable from both sides.
{LOAD_PERSISTENT_2PLAYER {SIDE1} {SIDE2} {NAMESPACE} {GLOBAL_VAR} gold_store}
{SET_MP_GOLD {SIDE1} }
{IF_FIRST_SCENARIO (
{LOAD_PERSISTENT_2PLAYER {SIDE1} {SIDE2} {NAMESPACE} {GLOBAL_VAR} gold_store}
{SET_MP_GOLD {SIDE1} }
)}
#enddef

#define GET_PERSISTENT_GOLD_FROM3 SIDE1 SIDE2 SIDE3 NAMESPACE GLOBAL_VAR
#Loads the recall list variable from both sides.
{LOAD_PERSISTENT_3PLAYER {SIDE1} {SIDE2} {SIDE3} {NAMESPACE} {GLOBAL_VAR} gold_store}
{SET_MP_GOLD {SIDE1} }
{IF_FIRST_SCENARIO (
{LOAD_PERSISTENT_3PLAYER {SIDE1} {SIDE2} {SIDE3} {NAMESPACE} {GLOBAL_VAR} gold_store}
{SET_MP_GOLD {SIDE1} }
)}
#enddef

#define GET_PERSISTENT_GOLD_FROM4 SIDE1 SIDE2 SIDE3 SIDE4 NAMESPACE GLOBAL_VAR
#Loads the recall list variable from both sides.
{LOAD_PERSISTENT_4PLAYER {SIDE1} {SIDE2} {SIDE3} {SIDE4} {NAMESPACE} {GLOBAL_VAR} gold_store}
{SET_MP_GOLD {SIDE1} }
{IF_FIRST_SCENARIO (
{LOAD_PERSISTENT_4PLAYER {SIDE1} {SIDE2} {SIDE3} {SIDE4} {NAMESPACE} {GLOBAL_VAR} gold_store}
{SET_MP_GOLD {SIDE1} }
)}
#enddef

0 comments on commit 8a04442

Please sign in to comment.