aboutsummaryrefslogtreecommitdiff
path: root/io.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 /io.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 'io.c')
-rw-r--r--io.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/io.c b/io.c
index 17c6166..55c1415 100644
--- a/io.c
+++ b/io.c
@@ -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) {
bgstack15