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.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.c')
-rw-r--r-- | ai.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |