From 61477ba75dd35655f38b3f280cd20cbe43b46d5a Mon Sep 17 00:00:00 2001 From: Nathan Vance Date: Wed, 29 Apr 2015 21:04:29 -0400 Subject: Fixed bug causing array content to be overwritten --- ai_weights_special.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ai_weights_special.c') 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++; } -- cgit