aboutsummaryrefslogtreecommitdiff
path: root/ai_weights_special.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-04-29 21:04:29 -0400
committerNathan Vance <nathav63@gmail.com>2015-04-29 21:04:29 -0400
commit61477ba75dd35655f38b3f280cd20cbe43b46d5a (patch)
tree2a234bb75325707c7461ec11bc7a8516cec473da /ai_weights_special.c
parentFixed ai trying to play cards not in its hand (diff)
download7w-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.c7
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++;
}
bgstack15