mapmenu and helpmenu in the multiplayer selection screen disapeared after a OGC message came in.. even browsing was cut of. Misstake found in file ogcache-client.c the loop started the browing again.

wait_for_players is now handling the sym key of the keyboard.
origin
stpohle 22 years ago
parent a7f683c7b9
commit e04cafe44d

@ -307,7 +307,7 @@ wait_for_players ()
bman.state = GS_startup;
}
if (keys[SDLK_F8] && event.type == SDL_KEYDOWN) {
if (event.key.keysym.sym == SDLK_F8 && event.type == SDL_KEYDOWN) {
/* Switch Fullscreen */
SDL_WM_ToggleFullScreen(gfx.screen);
gfx.fullscreen = !gfx.fullscreen;
@ -316,7 +316,7 @@ wait_for_players ()
if (bman.p_nr != -1) {
if (keys[SDLK_LEFT] && (!keypressed) && players[bman.p_nr].gfx_nr == -1) {
if (event.key.keysym.sym == SDLK_LEFT && event.type == SDL_KEYDOWN && (!keypressed) && players[bman.p_nr].gfx_nr == -1) {
i = 0;
while (selgfx < 0 || selgfx >= MAX_PLAYERS || i != -1) {
selgfx--;
@ -326,7 +326,7 @@ wait_for_players ()
}
}
if (keys[SDLK_RIGHT] && (!keypressed) && players[bman.p_nr].gfx_nr == -1) {
if (event.key.keysym.sym == SDLK_RIGHT && event.type == SDL_KEYDOWN && (!keypressed) && players[bman.p_nr].gfx_nr == -1) {
i = 0;
while (selgfx < 0 || selgfx >= MAX_PLAYERS || i != -1) {
selgfx++;
@ -347,7 +347,7 @@ wait_for_players ()
}
}
if ((keys[SDLK_LCTRL] || keys[SDLK_RCTRL]) && (!keypressed)) {
if ((event.key.keysym.sym == SDLK_LCTRL || event.key.keysym.sym == SDLK_RCTRL) && event.type == SDL_KEYDOWN && (!keypressed)) {
if (players[bman.p_nr].gfx_nr == -1)
/* select player */
players[bman.p_nr].gfx_nr = selgfx;
@ -359,12 +359,12 @@ wait_for_players ()
keypressed = 1;
}
if ((GT_MP_PTPM) && ready && keys[SDLK_F4] && (!keypressed)) {
if ((GT_MP_PTPM) && ready && event.key.keysym.sym == SDLK_F4 && event.type == SDL_KEYDOWN && (!keypressed)) {
done = 1;
bman.updatestatusbar = 1;
}
if (keys[SDLK_F2] && (!keypressed)) {
if (event.key.keysym.sym == SDLK_F2 && (!keypressed)) {
/* Map modification or setting display */
if (GT_MP_PTPM) {
mapmenu ();
@ -392,7 +392,7 @@ wait_for_players ()
bman.updatestatusbar = 1;
}
if (keys[SDLK_F1] && (!keypressed)) /* open help screen */
if (event.key.keysym.sym == SDLK_F1 && event.type == SDL_KEYDOWN && (!keypressed)) /* open help screen */
network_helpscreen ();
chat_loop (&event);

@ -1,4 +1,4 @@
/* $Id: network.c,v 1.52 2004/01/04 03:22:49 stpohle Exp $ */
/* $Id: network.c,v 1.53 2004/01/06 04:49:36 stpohle Exp $ */
/*
network routines.
*/
@ -408,7 +408,7 @@ net_transmit_gamedata ()
else
net_istep = 3;
while (!done && bman.state == GS_update) {
while (!done && (bman.state == GS_update || (GT_MP_PTPS && net_istep != 0))) {
/* the network thing */
network_loop ();

@ -1,4 +1,4 @@
/* $Id: ogcache-client.c,v 1.2 2004/01/03 22:32:18 stpohle Exp $
/* $Id: ogcache-client.c,v 1.3 2004/01/06 04:49:36 stpohle Exp $
* OpenGameCache-Client: this file will hold the protocol for the gameserver communication
*/
@ -249,7 +249,7 @@ int ogc_loop () {
i = ogc_do_inpacket (in, len, &inaddr);
}
if ((time (NULL) - ogc_lasttimeout) > 30)
if (ogc_browsing && (time (NULL) - ogc_lasttimeout) > 30)
ogc_browsestart ();
return i;

@ -619,7 +619,7 @@ do_playerdata (struct pkg_playerdata *p_dat, _net_addr * addr)
if (bman.state == GS_update && PS_IS_used (p_dat->state))
bman.players_nr_s++;
if (bman.state == GS_update && players[bman.p_nr].net.net_istep == 1)
if (players[bman.p_nr].net.net_istep == 1)
players[bman.p_nr].net.net_status = p_dat->p_nr;
}
@ -990,7 +990,7 @@ do_fieldline (struct pkg_fieldline *f_dat, _net_addr * addr)
return;
}
if (bman.state == GS_update && players[bman.p_nr].net.net_istep == 2)
if (players[bman.p_nr].net.net_istep == 2)
players[bman.p_nr].net.net_status = f_dat->line;
for (i = 0; i < MAX_FIELDSIZE_X; i++) {

Loading…
Cancel
Save