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 /io.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 'io.c')
-rw-r--r-- | io.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -14,6 +14,7 @@ char* cards_specialmessage(int era, int card); int data_getera(); int* data_gethand(int p); int* get_special(int era, int card, int player); +void arraycpy(int *from, int *to, int len); void io_init() { @@ -194,9 +195,9 @@ int print_cards(int x, int y, int *cards, int cursor); int io_printhand(int x, int y, int player, int cursor, int mode) //mode 0 is normal, 1 is discard search { - int *hand; - if(mode) hand = data_getdiscards(); - else hand = data_gethand(player); + int hand[7]; + if(mode) arraycpy(data_getdiscards(), hand, 7); + else arraycpy(data_gethand(player), hand, 7); int i; io_printborder(x, y++, 28); if(mode) { |