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.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ai.c') diff --git a/ai.c b/ai.c index 2f78a74..0a0936a 100644 --- a/ai.c +++ b/ai.c @@ -20,6 +20,7 @@ int data_hasbuiltname(int p, int era, int card); int* get_intarray(int size); int* ai_trade(int player, int era, int card); void write_trade(int player, int tradel, int trader); +void arraycpy(int *from, int *to, int len); void ai_bestcard(int *hand, int player, int *ret) { @@ -53,7 +54,8 @@ void ai_bestcard(int *hand, int player, int *ret) void ai_turn(int player) { int bestcard[5]; - int *hand = data_gethand(player); + int hand[7]; + arraycpy(data_gethand(player), hand, 7); int *wonder = get_intarray(4); wonder[0] = 0; int i; -- cgit