diff options
author | Nathan Vance <nathav63@gmail.com> | 2015-04-29 21:04:29 -0400 |
---|---|---|
committer | Nathan Vance <nathav63@gmail.com> | 2015-04-29 21:04:29 -0400 |
commit | 61477ba75dd35655f38b3f280cd20cbe43b46d5a (patch) | |
tree | 2a234bb75325707c7461ec11bc7a8516cec473da /ai_weights_special.c | |
parent | Fixed ai trying to play cards not in its hand (diff) | |
download | 7w-61477ba75dd35655f38b3f280cd20cbe43b46d5a.tar.gz 7w-61477ba75dd35655f38b3f280cd20cbe43b46d5a.tar.bz2 7w-61477ba75dd35655f38b3f280cd20cbe43b46d5a.zip |
Fixed bug causing array content to be overwritten
Diffstat (limited to 'ai_weights_special.c')
-rw-r--r-- | ai_weights_special.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ai_weights_special.c b/ai_weights_special.c index 32c13dd..1168421 100644 --- a/ai_weights_special.c +++ b/ai_weights_special.c @@ -21,10 +21,11 @@ int weight_marketplace(int player) { int weight = 0; int i, j; - int *prod = data_gettradables(player); - int *trade; + int prod[GOLD+1]; + arraycpy(data_gettradables(player), prod, GOLD+1); + int trade[GOLD+1]; for(i = 0; i < 2; i++) { - trade = data_gettradables(data_getdir(i, player)); + arraycpy(data_gettradables(data_getdir(i, player)), trade, GOLD+1); for(j = CLOTH; j <= PAPER; j++) { if(trade[j] && !prod[j]) weight++; } |