From ef86a9fafe44eeffdda3a301ca4a2f586602f481 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 5 Nov 1998 21:23:07 +0100 Subject: [PATCH] rnd-19981105-1 --- src/events.c | 20 +++----------------- src/files.c | 42 ++++++++++++++++++++++-------------------- src/game.c | 31 +++++++++++++++++++++---------- src/main.h | 7 +++++-- src/network.c | 2 +- src/screens.c | 10 +++++++++- src/screens.h | 2 +- 7 files changed, 62 insertions(+), 52 deletions(-) diff --git a/src/events.c b/src/events.c index 2eadeee6..2a858b8d 100644 --- a/src/events.c +++ b/src/events.c @@ -407,19 +407,9 @@ void HandleKey(KeySym key, int key_status) key_action |= key_info[i].action; if (key_status == KEY_PRESSED) - { - if (network_playing) - stored_player[pnr].potential_action |= key_action; - else - stored_player[pnr].action |= key_action; - } + stored_player[pnr].action |= key_action; else - { - if (network_playing) - stored_player[pnr].potential_action &= ~key_action; - else - stored_player[pnr].action &= ~key_action; - } + stored_player[pnr].action &= ~key_action; } } else @@ -890,13 +880,9 @@ static int HandleJoystickForAllPlayers() continue; joy_action = Joystick(i); - result |= joy_action; - if (network_playing) - stored_player[i].potential_action = joy_action; - else - stored_player[i].action = joy_action; + stored_player[i].action = joy_action; } return result; diff --git a/src/files.c b/src/files.c index 31ef7742..d96e3bf2 100644 --- a/src/files.c +++ b/src/files.c @@ -514,26 +514,27 @@ void SaveScore(int level_nr) #define SETUP_TOKEN_FADING 8 #define SETUP_TOKEN_AUTORECORD 9 #define SETUP_TOKEN_QUICK_DOORS 10 -#define SETUP_TOKEN_ALIAS_NAME 11 - -#define SETUP_TOKEN_USE_JOYSTICK 12 -#define SETUP_TOKEN_JOY_DEVICE_NAME 13 -#define SETUP_TOKEN_JOY_XLEFT 14 -#define SETUP_TOKEN_JOY_XMIDDLE 15 -#define SETUP_TOKEN_JOY_XRIGHT 16 -#define SETUP_TOKEN_JOY_YUPPER 17 -#define SETUP_TOKEN_JOY_YMIDDLE 18 -#define SETUP_TOKEN_JOY_YLOWER 19 -#define SETUP_TOKEN_JOY_SNAP 20 -#define SETUP_TOKEN_JOY_BOMB 21 -#define SETUP_TOKEN_KEY_LEFT 22 -#define SETUP_TOKEN_KEY_RIGHT 23 -#define SETUP_TOKEN_KEY_UP 24 -#define SETUP_TOKEN_KEY_DOWN 25 -#define SETUP_TOKEN_KEY_SNAP 26 -#define SETUP_TOKEN_KEY_BOMB 27 - -#define NUM_SETUP_TOKENS 28 +#define SETUP_TOKEN_TEAM_MODE 11 +#define SETUP_TOKEN_ALIAS_NAME 12 + +#define SETUP_TOKEN_USE_JOYSTICK 13 +#define SETUP_TOKEN_JOY_DEVICE_NAME 14 +#define SETUP_TOKEN_JOY_XLEFT 15 +#define SETUP_TOKEN_JOY_XMIDDLE 16 +#define SETUP_TOKEN_JOY_XRIGHT 17 +#define SETUP_TOKEN_JOY_YUPPER 18 +#define SETUP_TOKEN_JOY_YMIDDLE 19 +#define SETUP_TOKEN_JOY_YLOWER 20 +#define SETUP_TOKEN_JOY_SNAP 21 +#define SETUP_TOKEN_JOY_BOMB 22 +#define SETUP_TOKEN_KEY_LEFT 23 +#define SETUP_TOKEN_KEY_RIGHT 24 +#define SETUP_TOKEN_KEY_UP 25 +#define SETUP_TOKEN_KEY_DOWN 26 +#define SETUP_TOKEN_KEY_SNAP 27 +#define SETUP_TOKEN_KEY_BOMB 28 + +#define NUM_SETUP_TOKENS 29 #define FIRST_GLOBAL_SETUP_TOKEN SETUP_TOKEN_SOUND #define LAST_GLOBAL_SETUP_TOKEN SETUP_TOKEN_ALIAS_NAME @@ -567,6 +568,7 @@ static struct { TYPE_SWITCH, &si.fading, "screen_fading" }, { TYPE_SWITCH, &si.autorecord, "automatic_tape_recording" }, { TYPE_SWITCH, &si.quick_doors, "quick_doors" }, + { TYPE_SWITCH, &si.team_mode, "team_mode" }, { TYPE_STRING, &si.alias_name, "alias_name" }, /* for each player: */ diff --git a/src/game.c b/src/game.c index 08d980b2..c19a74da 100644 --- a/src/game.c +++ b/src/game.c @@ -59,7 +59,7 @@ void InitGame() player->active = FALSE; player->action = 0; - player->potential_action = 0; + player->effective_action = 0; player->score = 0; player->gems_still_needed = level.edelsteine; @@ -287,6 +287,12 @@ void InitGame() } } + /* when in single player mode, eliminate all but the first active player */ + if (!options.network && !setup.team_mode) + for(i=0; ieffective_action = summarized_player_action; + for(i=0; i