aboutsummaryrefslogtreecommitdiff
path: root/wonder.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 /wonder.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 'wonder.c')
-rw-r--r--wonder.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/wonder.c b/wonder.c
index dc1ba83..16c5647 100644
--- a/wonder.c
+++ b/wonder.c
@@ -25,6 +25,7 @@ int* data_getdefinites(int p);
int** data_getindefinites(int p);
int data_gettotvps(int p);
int military_might(int player);
+void arraycpy(int *from, int *to, int len);
int wonder_numstages(int player)
{
@@ -63,7 +64,8 @@ int* print_wonder(int x, int y, int player, int cursor)
io_printborder(x, y++, 28);
//Print resource incomes
- int *def = data_getdefinites(player);
+ int def[GOLD];
+ arraycpy(data_getdefinites(player), def, GOLD);
def[cards_gettype(data_getwonder(player), 0)]++;
int **indef = data_getindefinites(player);
y = io_printtext(x, y, 28, "Production:");
bgstack15