Deathmatch classic support

This commit is contained in:
Wizzard
2023-09-20 08:46:08 -04:00
parent c1ff555e17
commit c5e985bc42
4 changed files with 16 additions and 1 deletions

View File

@@ -38,6 +38,8 @@ GameType get_current_game(void) {
current_game = GAME_CS16;
} else if (strcmp(gameTypeToken, "dod") == 0) {
current_game = GAME_DAY_OF_DEFEAT;
} else if (strcmp(gameTypeToken, "dmc") == 0) {
current_game = GAME_DMC;
} else if (strcmp(gameTypeToken, "tfc") == 0) {
current_game = GAME_TFC;
}
@@ -66,3 +68,7 @@ int IsDayOfDefeat(void) {
int IsTFC(void) {
return get_current_game() == GAME_TFC;
}
int IsDeathmatchClassic(void) {
return get_current_game() == GAME_DMC;
}

View File

@@ -6,7 +6,8 @@ typedef enum {
GAME_HALFLIFE,
GAME_CS16,
GAME_TFC,
GAME_DAY_OF_DEFEAT
GAME_DAY_OF_DEFEAT,
GAME_DMC
} GameType;
GameType get_current_game(void);
@@ -14,5 +15,6 @@ int IsCS16(void);
int IsHalfLife(void);
int IsDayOfDefeat(void);
int IsTFC(void);
int IsDeathmatchClassic(void);
#endif

View File

@@ -49,6 +49,9 @@ void load(void) {
else if (IsTFC()) {
i_engine->pfnClientCmd("play 'sound/misc/party2.wav'");
}
else if (IsDeathmatchClassic()) {
i_engine->pfnClientCmd("play 'sound/items/suit.wav'");
}
else
{
i_engine->pfnClientCmd("play 'valve/sound/vox/suit.wav'");
@@ -73,6 +76,9 @@ void load(void) {
case GAME_TFC:
i_engine->pfnClientCmd("echo \"Detected Game: Team Fortress Classic\"");
break;
case GAME_DMC:
i_engine->pfnClientCmd("echo \"Detected Game: Deathmatch Classic\"");
break;
default:
i_engine->pfnClientCmd("echo \"Detected Game: Unknown Game\"");
break;