first player was always rest in team1 but team 1 had no players in it's list

origin
stpohle 21 years ago
parent 4c85f60433
commit 7df4ebe083

@ -104,7 +104,7 @@ network_options ()
void
multiplayer_firstrun ()
{
int i;
int i, j;
/*
reset some gamedata
*/
@ -123,8 +123,17 @@ multiplayer_firstrun ()
players[i].net.pingreq = 20;
players[i].net.pingack = 22;
players[i].state = 0;
players[i].team_nr = -1;
}
for (i = 0; i < MAX_TEAMS; i++) {
teams[i].wins = 0;
teams[i].points = 0;
for (j= 0; j < MAX_PLAYERS; j++)
teams[i].players[j] = NULL;
}
bman.lastwinner = -1;
bman.players_nr_s = 1;
};

@ -1,4 +1,4 @@
/* $Id: single.c,v 1.73 2004/09/26 16:46:36 stpohle Exp $ */
/* $Id: single.c,v 1.74 2004/09/26 22:16:34 stpohle Exp $ */
/* single player */
#include "basic.h"
@ -606,16 +606,26 @@ single_playergame (int second_player, int ai_players)
bman.p_nr = -1;
bman.p2_nr = -1;
/* delete player from the game */
/* delete player and teams from the game */
for (p = 0; p < MAX_PLAYERS; p++) {
players[p].points = 0;
players[p].wins = 0;
players[p].state = 0;
players[p].team_nr = -1;
players[p].gfx_nr = -1;
players[p].gfx = NULL;
memset (&players[p].net, 0x0, sizeof (_net_player));
}
for (p = 0; p < MAX_TEAMS; p++) {
teams[p].wins = 0;
teams[p].points = 0;
for (done = 0; done < MAX_PLAYERS; done++)
teams[p].players[done] = NULL;
}
done = 0;
for (bman.p_nr = -1, p = 0; (bman.p_nr == -1 && p < MAX_PLAYERS); p++)
if (!(PS_IS_used (players[p].state)))
bman.p_nr = p;

Loading…
Cancel
Save