diff --git a/src/game_detection.c b/src/game_detection.c index 856d447..98f5474 100644 --- a/src/game_detection.c +++ b/src/game_detection.c @@ -42,7 +42,9 @@ GameType get_current_game(void) { current_game = GAME_DMC; } else if (strcmp(gameTypeToken, "tfc") == 0) { current_game = GAME_TFC; - } + } else if (strcmp(gameTypeToken, "SpaceLife") == 0) { + current_game = GAME_SL; + } } else if (steamToken && tokensFound == 2) { // If only `-steam` is found and no `-game`, with only two tokens, assume it's Half-Life 1 current_game = GAME_HALFLIFE; @@ -72,3 +74,7 @@ int IsTFC(void) { int IsDeathmatchClassic(void) { return get_current_game() == GAME_DMC; } + +int IsSpaceLife(void) { + return get_current_game() == GAME_SL; +} diff --git a/src/include/game_detection.h b/src/include/game_detection.h index 686c8e3..3ea7076 100644 --- a/src/include/game_detection.h +++ b/src/include/game_detection.h @@ -7,7 +7,8 @@ typedef enum { GAME_CS16, GAME_TFC, GAME_DAY_OF_DEFEAT, - GAME_DMC + GAME_DMC, + GAME_SL } GameType; GameType get_current_game(void); @@ -16,5 +17,6 @@ int IsHalfLife(void); int IsDayOfDefeat(void); int IsTFC(void); int IsDeathmatchClassic(void); +int IsSpaceLife(void); #endif diff --git a/src/include/globals.h b/src/include/globals.h index f304059..d661427 100644 --- a/src/include/globals.h +++ b/src/include/globals.h @@ -9,6 +9,7 @@ enum game_id { CS = 1, /* Counter-Strike 1.6 */ TF = 2, /* Team Fortress Classic */ DOD = 3, /* Day of Defeat */ + SL = 4, /* Space Life: Finleys Revenge */ }; /*----------------------------------------------------------------------------*/ diff --git a/src/main.c b/src/main.c index 6006126..9e554ba 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,5 @@ +#include #include #include @@ -51,6 +52,9 @@ void load(void) { else if (IsDeathmatchClassic()) { i_engine->pfnClientCmd("play 'sound/items/suit.wav'"); } + else if (IsSpaceLife()) { + i_engine->pfnClientCmd("play 'sound/finley/soccer_ball.wav'"); + } else { i_engine->pfnClientCmd("play 'valve/sound/vox/suit.wav'"); @@ -78,6 +82,9 @@ void load(void) { case GAME_DMC: i_engine->pfnClientCmd("echo \"Detected Game: Deathmatch Classic\""); break; + case GAME_SL: + i_engine->pfnClientCmd("echo \"Detected Game: Space Life: Finley's Revenge\""); + break; default: i_engine->pfnClientCmd("echo \"Detected Game: Unknown Game\""); break;