X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=23fcc2d4f6819093b0a003964f7ec4fe4a517e7e;hb=8cef2a63b6c56ba086183693d3f73f02862cbd8f;hp=4851f4aa7745267c5226d1012c325fba70dcac4f;hpb=e5c5bf5c4a76a04f9bf64e92227bf2ef969fd25c;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index 4851f4aa..23fcc2d4 100644 --- a/src/game.c +++ b/src/game.c @@ -25,7 +25,7 @@ void GetPlayerConfig() { - int old_joystick_nr = setup.joystick_nr; + int old_joystick_nr = setup.joy_input[0].joystick_nr; if (sound_status==SOUND_OFF) local_player->setup &= ~SETUP_SOUND; @@ -42,13 +42,19 @@ void GetPlayerConfig() setup.direct_draw_on = SETUP_DIRECT_DRAW_ON(local_player->setup); setup.fading_on = SETUP_FADING_ON(local_player->setup); setup.autorecord_on = SETUP_AUTO_RECORD_ON(local_player->setup); + +#if 0 setup.joystick_nr = SETUP_2ND_JOYSTICK_ON(local_player->setup); +#endif + + setup.joy_input[0].joystick_nr = SETUP_2ND_JOYSTICK_ON(local_player->setup); + setup.quick_doors = SETUP_QUICK_DOORS_ON(local_player->setup); setup.scroll_delay_on = SETUP_SCROLL_DELAY_ON(local_player->setup); setup.soft_scrolling_on = SETUP_SOFT_SCROLL_ON(local_player->setup); #ifndef MSDOS - if (setup.joystick_nr != old_joystick_nr) + if (setup.joy_input[0].joystick_nr != old_joystick_nr) { if (joystick_device) close(joystick_device); @@ -197,17 +203,26 @@ void InitGame() { player->active = TRUE; + /* remove potentially duplicate players */ + if (StorePlayer[jx][jy] == Feld[x][y]) + StorePlayer[jx][jy] = 0; + + StorePlayer[x][y] = Feld[x][y]; + printf("Player %d activated.\n", player->element_nr); printf("[Local player is %d and currently %s.]\n", local_player->element_nr, local_player->active ? "active" : "not active"); } +#if 0 /* remove potentially duplicate players */ if (StorePlayer[jx][jy] == Feld[x][y]) StorePlayer[jx][jy] = 0; StorePlayer[x][y] = Feld[x][y]; +#endif + Feld[x][y] = EL_LEERRAUM; player->jx = player->last_jx = x; player->jy = player->last_jy = y; @@ -2939,18 +2954,13 @@ void GameActions(byte player_action) long action_delay_value; int sieb_x = 0, sieb_y = 0; int i, x,y, element; - int *recorded_player_action; + byte *recorded_player_action; if (game_status != PLAYING) return; -#ifdef DEBUG - action_delay_value = - (tape.playing && tape.fast_forward ? FFWD_FRAME_DELAY : GameFrameDelay); -#else action_delay_value = - (tape.playing && tape.fast_forward ? FFWD_FRAME_DELAY : GAME_FRAME_DELAY); -#endif + (tape.playing && tape.fast_forward ? FfwdFrameDelay : GameFrameDelay); /* main game synchronization point */ WaitUntilDelayReached(&action_delay, action_delay_value); @@ -2986,32 +2996,16 @@ void GameActions(byte player_action) else if (tape.recording) TapeRecordDelay(); - - if (tape.playing) - recorded_player_action = TapePlayAction(); - else - recorded_player_action = NULL; + recorded_player_action = (tape.playing ? TapePlayAction() : NULL); if (network_playing) SendToServer_MovePlayer(player_action); for(i=0; i