Skip to content

Commit

Permalink
Added CVar mp_location_area_info for display location area info in HU…
Browse files Browse the repository at this point in the history
…Ds radio chat and below radar
  • Loading branch information
s1lentq committed Apr 7, 2024
1 parent f711276 commit 1ae0091
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab
| mp_freezetime_duck | 1 | 0 | 1 | Allow players to duck during freezetime.<br/> `0` disabled<br/>`1` enabled |
| mp_freezetime_jump | 1 | 0 | 1 | Allow players to jump during freezetime.<br/> `0` disabled<br/>`1` enabled |
| mp_defuser_allocation | 0 | 0 | 2 | Give defuser on player spawn.<br/> `0` disabled<br/>`1` Random players. <br/>`2` All players. |
| mp_location_area_info | 0 | 0 | 1 | Enable location area info.<br/> `0` disabled<br/>`1` enabled.<br/>Usually displayed in HUDs below radar or in radio chat as a prefix.<br/>`NOTE`: Navigation `maps/.nav` file required and should contain place names |
</details>

## How to install zBot for CS 1.6?
Expand Down
10 changes: 10 additions & 0 deletions dist/game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -575,3 +575,13 @@ mp_freezetime_jump "1"
//
// Default value: "0"
mp_defuser_allocation "0"

// Enable location area info
// Usually displayed in HUDs below radar or in radio chat as a prefix
// 0 - disabled (default behavior)
// 1 - enabled
//
// NOTE: Navigation maps/.nav file required and should contain place names
//
// Default value: "0"
mp_location_area_info "0"
3 changes: 3 additions & 0 deletions regamedll/dlls/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3723,6 +3723,9 @@ void EXT_FUNC ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)

#ifdef REGAMEDLL_ADD
CSGameRules()->ServerActivate();

if (location_area_info.value)
LoadNavigationMap();
#endif
}

Expand Down
2 changes: 2 additions & 0 deletions regamedll/dlls/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ cvar_t legacy_vehicle_block = { "mp_legacy_vehicle_block", "1", 0,

cvar_t dying_time = { "mp_dying_time", "3.0", 0, 3.0f, nullptr };
cvar_t defuser_allocation = { "mp_defuser_allocation", "0", 0, 0.0f, nullptr };
cvar_t location_area_info = { "mp_location_area_info", "0", 0, 0.0f, nullptr };

void GameDLL_Version_f()
{
Expand Down Expand Up @@ -441,6 +442,7 @@ void EXT_FUNC GameDLLInit()
CVAR_REGISTER(&freezetime_duck);
CVAR_REGISTER(&freezetime_jump);
CVAR_REGISTER(&defuser_allocation);
CVAR_REGISTER(&location_area_info);

// print version
CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n");
Expand Down
1 change: 1 addition & 0 deletions regamedll/dlls/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ extern cvar_t assist_damage_threshold;
extern cvar_t freezetime_duck;
extern cvar_t freezetime_jump;
extern cvar_t defuser_allocation;
extern cvar_t location_area_info;

#endif

Expand Down
6 changes: 5 additions & 1 deletion regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10083,7 +10083,11 @@ void CBasePlayer::UpdateLocation(bool forceUpdate)

const char *placeName = "";

if (pev->deadflag == DEAD_NO && AreBotsAllowed())
if (pev->deadflag == DEAD_NO && (
#ifdef REGAMEDLL_ADD
location_area_info.value ||
#endif
AreBotsAllowed()))
{
// search the place name where is located the player
Place playerPlace = TheNavAreaGrid.GetPlace(&pev->origin);
Expand Down

0 comments on commit 1ae0091

Please sign in to comment.