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

@ -15,6 +15,7 @@ Supported games:
- [[https://store.steampowered.com/app/10/CounterStrike/][Counter-Strike 1.6]] - [[https://store.steampowered.com/app/10/CounterStrike/][Counter-Strike 1.6]]
- [[https://store.steampowered.com/app/20/Team_Fortress_Classic/][Team Fortress Classic]] - [[https://store.steampowered.com/app/20/Team_Fortress_Classic/][Team Fortress Classic]]
- [[https://store.steampowered.com/app/30/Day_of_Defeat/][Day of Defeat]] - [[https://store.steampowered.com/app/30/Day_of_Defeat/][Day of Defeat]]
- [[https://store.steampowered.com/app/40/Deathmatch_Classic/][Deathmatch Classic]]
This project was heavily inspired by [[https://github.com/UnkwUsr/hlhax][UnkwUsr/hlhax]], and would not have been This project was heavily inspired by [[https://github.com/UnkwUsr/hlhax][UnkwUsr/hlhax]], and would not have been
possible without his help. Make sure to check out his repo too. possible without his help. Make sure to check out his repo too.

View File

@ -38,6 +38,8 @@ GameType get_current_game(void) {
current_game = GAME_CS16; current_game = GAME_CS16;
} else if (strcmp(gameTypeToken, "dod") == 0) { } else if (strcmp(gameTypeToken, "dod") == 0) {
current_game = GAME_DAY_OF_DEFEAT; current_game = GAME_DAY_OF_DEFEAT;
} else if (strcmp(gameTypeToken, "dmc") == 0) {
current_game = GAME_DMC;
} else if (strcmp(gameTypeToken, "tfc") == 0) { } else if (strcmp(gameTypeToken, "tfc") == 0) {
current_game = GAME_TFC; current_game = GAME_TFC;
} }
@ -66,3 +68,7 @@ int IsDayOfDefeat(void) {
int IsTFC(void) { int IsTFC(void) {
return get_current_game() == GAME_TFC; 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_HALFLIFE,
GAME_CS16, GAME_CS16,
GAME_TFC, GAME_TFC,
GAME_DAY_OF_DEFEAT GAME_DAY_OF_DEFEAT,
GAME_DMC
} GameType; } GameType;
GameType get_current_game(void); GameType get_current_game(void);
@ -14,5 +15,6 @@ int IsCS16(void);
int IsHalfLife(void); int IsHalfLife(void);
int IsDayOfDefeat(void); int IsDayOfDefeat(void);
int IsTFC(void); int IsTFC(void);
int IsDeathmatchClassic(void);
#endif #endif

View File

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