summaryrefslogtreecommitdiff
path: root/menuchoixpersos.c
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-01-07 23:38:45 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-01-07 23:56:39 +0100
commita24acb373d67048daa7e68e72418a5d6ef5841dd (patch)
treed736bccb65609fb42cbe9181c83ef4616ebd382e /menuchoixpersos.c
parentf05eaa46329faf7c9c1bcd061f091a69289ba459 (diff)
added the current user to the team structure
the current character is generated randomly at the initialization of the team. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'menuchoixpersos.c')
-rw-r--r--menuchoixpersos.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/menuchoixpersos.c b/menuchoixpersos.c
index 215ee95..7a66c3f 100644
--- a/menuchoixpersos.c
+++ b/menuchoixpersos.c
@@ -72,6 +72,7 @@ struct team_t *new_ally_team(SURFACES *surfaces,
team->name = "Team Player";
team->cpu = false;
team->chr_cnt = cnt;
+ team->chr_cur = rand() % team->chr_cnt;
team->chrs = malloc(sizeof(struct character_t) * team->chr_cnt);
init_team_players(team, true, classes, surfaces);
@@ -111,6 +112,7 @@ struct team_t *new_enemy_team(SURFACES *surfaces, const struct team_t *ally_team
team->name = "Team CPU";
team->cpu = true;
team->chr_cnt = rand() % 5 + 1;
+ team->chr_cur = rand() % team->chr_cnt;
team->chrs = malloc(sizeof(struct character_t) * team->chr_cnt);
classes = malloc(sizeof(enum character_class_t) * team->chr_cnt);