Merge branch 'main' into show-c4-cvar

This commit is contained in:
Eason 2024-08-04 16:51:03 +08:00 committed by GitHub
commit 5200ba6da3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 79 additions and 6 deletions

View File

@ -103,7 +103,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab
| mp_team_flash | 1 | -1 | 1 | Sets the behaviour for Flashbangs on teammates.<br/>`-1` Don't affect teammates neither flash owner <br/>`0` Don't affect teammates <br/>`1` Affects teammates | | mp_team_flash | 1 | -1 | 1 | Sets the behaviour for Flashbangs on teammates.<br/>`-1` Don't affect teammates neither flash owner <br/>`0` Don't affect teammates <br/>`1` Affects teammates |
| mp_fadetoblack | 0 | 0 | 2 | Observer's screen will fade to black on kill event or permanent.<br/> `0` No fade.<br/>`1` Fade to black and won't be able to watch anybody.<br/>`2` fade to black only on kill moment. | | mp_fadetoblack | 0 | 0 | 2 | Observer's screen will fade to black on kill event or permanent.<br/> `0` No fade.<br/>`1` Fade to black and won't be able to watch anybody.<br/>`2` fade to black only on kill moment. |
| mp_falldamage | 1 | 0 | 1 | Damage from falling.<br/>`0` disabled <br/>`1` enabled | | mp_falldamage | 1 | 0 | 1 | Damage from falling.<br/>`0` disabled <br/>`1` enabled |
| sv_allchat | 1 | 0 | 1 | Players can receive all other players text chat, team restrictions apply<br/>`0` disabled <br/>`1` enabled | | sv_allchat | 1 | 0 | 1 | Players can receive all other players text chat, team restrictions apply<br/>`0` disabled <br/>`1` enabled <br/> `2` enabled, but only dead player can see spectator's message |
| sv_autobunnyhopping | 0 | 0 | 1 | Players automatically re-jump while holding jump button.<br/>`0` disabled <br/>`1` enabled | | sv_autobunnyhopping | 0 | 0 | 1 | Players automatically re-jump while holding jump button.<br/>`0` disabled <br/>`1` enabled |
| sv_enablebunnyhopping | 0 | 0 | 1 | Allow player speed to exceed maximum running speed.<br/>`0` disabled <br/>`1` enabled | | sv_enablebunnyhopping | 0 | 0 | 1 | Allow player speed to exceed maximum running speed.<br/>`0` disabled <br/>`1` enabled |
| mp_plant_c4_anywhere | 0 | 0 | 1 | When set, players can plant anywhere, not only in bombsites.<br/>`0` disabled <br/>`1` enabled | | mp_plant_c4_anywhere | 0 | 0 | 1 | When set, players can plant anywhere, not only in bombsites.<br/>`0` disabled <br/>`1` enabled |
@ -117,6 +117,9 @@ This means that plugins that do binary code analysis (Orpheu for example) probab
| mp_freezetime_jump | 1 | 0 | 1 | Allow players to jump 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_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 | 3 | Enable location area info.<br/> `0` disabled<br/>`1` show location below HUD radar.<br/>`2` show location in HUD chat. `NOT RECOMMENDED!` [:speech_balloon:](## "Not all client builds are compatible")<br/>`3` both displayed. `NOT RECOMMENDED!` [:speech_balloon:](## "Not all client builds are compatible")<br/><br/>`NOTE`: Navigation `maps/.nav` file required and should contain place names<br/>`NOTE`: If option `2` or `3` is enabled, be sure to enable `mp_chat_loc_fallback 1` | | mp_location_area_info | 0 | 0 | 3 | Enable location area info.<br/> `0` disabled<br/>`1` show location below HUD radar.<br/>`2` show location in HUD chat. `NOT RECOMMENDED!` [:speech_balloon:](## "Not all client builds are compatible")<br/>`3` both displayed. `NOT RECOMMENDED!` [:speech_balloon:](## "Not all client builds are compatible")<br/><br/>`NOTE`: Navigation `maps/.nav` file required and should contain place names<br/>`NOTE`: If option `2` or `3` is enabled, be sure to enable `mp_chat_loc_fallback 1` |
| mp_item_respawn_time | 30 | 0.0 | - | The respawn time for items (such as health packs, armor, etc.). |
| mp_weapon_respawn_time | 20 | 0.0 | - | The respawn time for weapons. |
| mp_ammo_respawn_time | 20 | 0.0 | - | The respawn time for ammunition. |
| mp_scoreboard_fix | 0 | 0 | 1 | Enable ReGameDLL scoreboard bug fix(Dead players could see the bomb or defuse kit).<br/> `0` disabled<br/>`1` enabled<br/>`NOTE`: Absolutely cannot fix it in "CNCS😂" | | mp_scoreboard_fix | 0 | 0 | 1 | Enable ReGameDLL scoreboard bug fix(Dead players could see the bomb or defuse kit).<br/> `0` disabled<br/>`1` enabled<br/>`NOTE`: Absolutely cannot fix it in "CNCS😂" |
</details> </details>

19
dist/game.cfg vendored
View File

@ -485,6 +485,7 @@ mp_team_flash "1"
// Players can receive all other players text chat, team restrictions apply. // Players can receive all other players text chat, team restrictions apply.
// 0 - disabled (default behaviour) // 0 - disabled (default behaviour)
// 1 - enabled // 1 - enabled
// 2 - enabled, but only dead player can see spectator'smessage
// //
// Default value: "0" // Default value: "0"
sv_allchat "0" sv_allchat "0"
@ -588,6 +589,24 @@ mp_defuser_allocation "0"
// Default value: "0" // Default value: "0"
mp_location_area_info "0" mp_location_area_info "0"
// The respawn time for items (such as health packs, armor, etc.).
// 0 - disable delay
//
// Default value: "30"
mp_item_respawn_time "30"
// The respawn time for weapons.
// 0 - disable delay
//
// Default value: "20"
mp_weapon_respawn_time "20"
// The respawn time for ammunition.
// 0 - disable delay
//
// Default value: "20"
mp_ammo_respawn_time "20"
// Enable ReGameDLL scoreboard bug fix(Dead players could see the bomb or defuse kit) // Enable ReGameDLL scoreboard bug fix(Dead players could see the bomb or defuse kit)
// 0 - disable // 0 - disable
// 1 - enabled // 1 - enabled

View File

@ -10,7 +10,11 @@ void CBasePlayerAmmo::Spawn()
SetTouch(&CBasePlayerAmmo::DefaultTouch); SetTouch(&CBasePlayerAmmo::DefaultTouch);
if (g_pGameRules->IsMultiplayer()) if (g_pGameRules->IsMultiplayer()
#ifdef REGAMEDLL_FIXES
&& g_pGameRules->AmmoShouldRespawn(this) == GR_AMMO_RESPAWN_NO
#endif
)
{ {
SetThink(&CBaseEntity::SUB_Remove); SetThink(&CBaseEntity::SUB_Remove);
pev->nextthink = gpGlobals->time + 2.0f; pev->nextthink = gpGlobals->time + 2.0f;

View File

@ -1010,6 +1010,17 @@ void Host_Say(edict_t *pEntity, BOOL teamonly)
continue; continue;
} }
// when allchat is 2,only dead player can see spectator's message
if (
#ifdef REGAMEDLL_ADD
allchat.value == 2.0f &&
#endif
(pPlayer->m_iTeam == UNASSIGNED || pPlayer->m_iTeam == SPECTATOR)
) {
if (pReceiver->pev->deadflag == DEAD_NO)
continue;
}
if ((pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_ENEMY && pReceiver->m_iTeam == pPlayer->m_iTeam) if ((pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_ENEMY && pReceiver->m_iTeam == pPlayer->m_iTeam)
|| pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_NONE) || pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_NONE)
{ {

View File

@ -181,6 +181,10 @@ cvar_t defuser_allocation = { "mp_defuser_allocation", "0", 0, 0.0f, nullpt
cvar_t location_area_info = { "mp_location_area_info", "0", 0, 0.0f, nullptr }; cvar_t location_area_info = { "mp_location_area_info", "0", 0, 0.0f, nullptr };
cvar_t chat_loc_fallback = { "mp_chat_loc_fallback", "1", 1, 0.0f, nullptr }; cvar_t chat_loc_fallback = { "mp_chat_loc_fallback", "1", 1, 0.0f, nullptr };
cvar_t item_respawn_time = { "mp_item_respawn_time", "30", FCVAR_SERVER, 30.0f, nullptr };
cvar_t weapon_respawn_time = { "mp_weapon_respawn_time", "20", FCVAR_SERVER, 20.0f, nullptr };
cvar_t ammo_respawn_time = { "mp_ammo_respawn_time", "20", FCVAR_SERVER, 20.0f, nullptr };
cvar_t scoreboard_fix = { "mp_scoreboard_fix", "0", FCVAR_SERVER, 0.0f, nullptr }; cvar_t scoreboard_fix = { "mp_scoreboard_fix", "0", FCVAR_SERVER, 0.0f, nullptr };
void GameDLL_Version_f() void GameDLL_Version_f()
@ -448,6 +452,10 @@ void EXT_FUNC GameDLLInit()
CVAR_REGISTER(&location_area_info); CVAR_REGISTER(&location_area_info);
CVAR_REGISTER(&chat_loc_fallback); CVAR_REGISTER(&chat_loc_fallback);
CVAR_REGISTER(&item_respawn_time);
CVAR_REGISTER(&weapon_respawn_time);
CVAR_REGISTER(&ammo_respawn_time);
CVAR_REGISTER(&scoreboard_fix); CVAR_REGISTER(&scoreboard_fix);
// print version // print version

View File

@ -204,6 +204,10 @@ extern cvar_t defuser_allocation;
extern cvar_t location_area_info; extern cvar_t location_area_info;
extern cvar_t chat_loc_fallback; extern cvar_t chat_loc_fallback;
extern cvar_t item_respawn_time;
extern cvar_t weapon_respawn_time;
extern cvar_t ammo_respawn_time;
extern cvar_t scoreboard_fix; extern cvar_t scoreboard_fix;
#endif #endif

View File

@ -4221,7 +4221,11 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(PlayerGotWeapon)(CBasePlayer *pPlay
// What is the time in the future at which this weapon may spawn? // What is the time in the future at which this weapon may spawn?
float CHalfLifeMultiplay::FlWeaponRespawnTime(CBasePlayerItem *pWeapon) float CHalfLifeMultiplay::FlWeaponRespawnTime(CBasePlayerItem *pWeapon)
{ {
#ifdef REGAMEDLL_ADD
return gpGlobals->time + weapon_respawn_time.value;
#else
return gpGlobals->time + WEAPON_RESPAWN_TIME; return gpGlobals->time + WEAPON_RESPAWN_TIME;
#endif
} }
// Returns 0 if the weapon can respawn now, // Returns 0 if the weapon can respawn now,
@ -4289,7 +4293,11 @@ int CHalfLifeMultiplay::ItemShouldRespawn(CItem *pItem)
// At what time in the future may this Item respawn? // At what time in the future may this Item respawn?
float CHalfLifeMultiplay::FlItemRespawnTime(CItem *pItem) float CHalfLifeMultiplay::FlItemRespawnTime(CItem *pItem)
{ {
#ifdef REGAMEDLL_ADD;
return gpGlobals->time + item_respawn_time.value;
#else
return gpGlobals->time + ITEM_RESPAWN_TIME; return gpGlobals->time + ITEM_RESPAWN_TIME;
#endif
} }
// Where should this item respawn? // Where should this item respawn?
@ -4321,7 +4329,11 @@ int CHalfLifeMultiplay::AmmoShouldRespawn(CBasePlayerAmmo *pAmmo)
float CHalfLifeMultiplay::FlAmmoRespawnTime(CBasePlayerAmmo *pAmmo) float CHalfLifeMultiplay::FlAmmoRespawnTime(CBasePlayerAmmo *pAmmo)
{ {
return gpGlobals->time + 20.0f; #ifdef REGAMEDLL_ADD
return gpGlobals->time + ammo_respawn_time.value;
#else
return gpGlobals->time + AMMO_RESPAWN_TIME;
#endif
} }
Vector CHalfLifeMultiplay::VecAmmoRespawnSpot(CBasePlayerAmmo *pAmmo) Vector CHalfLifeMultiplay::VecAmmoRespawnSpot(CBasePlayerAmmo *pAmmo)

View File

@ -518,7 +518,11 @@ void CBasePlayerItem::Materialize()
UTIL_SetOrigin(pev, pev->origin); UTIL_SetOrigin(pev, pev->origin);
SetTouch(&CBasePlayerItem::DefaultTouch); SetTouch(&CBasePlayerItem::DefaultTouch);
if (g_pGameRules->IsMultiplayer()) if (g_pGameRules->IsMultiplayer()
#ifdef REGAMEDLL_FIXES
&& g_pGameRules->WeaponShouldRespawn(this) == GR_WEAPON_RESPAWN_NO
#endif
)
{ {
if (!CanDrop()) if (!CanDrop())
{ {
@ -555,8 +559,12 @@ void CBasePlayerItem::CheckRespawn()
{ {
switch (g_pGameRules->WeaponShouldRespawn(this)) switch (g_pGameRules->WeaponShouldRespawn(this))
{ {
case GR_WEAPON_RESPAWN_YES: case GR_WEAPON_RESPAWN_YES: {
#ifdef REGAMEDLL_FIXES
Respawn();
#endif
return; return;
}
case GR_WEAPON_RESPAWN_NO: case GR_WEAPON_RESPAWN_NO:
return; return;
} }
@ -575,6 +583,10 @@ CBaseEntity *CBasePlayerItem::Respawn()
// invisible for now // invisible for now
pNewWeapon->pev->effects |= EF_NODRAW; pNewWeapon->pev->effects |= EF_NODRAW;
#ifdef REGAMEDLL_ADD
pNewWeapon->pev->spawnflags &= ~SF_NORESPAWN;
#endif
// no touch // no touch
pNewWeapon->SetTouch(nullptr); pNewWeapon->SetTouch(nullptr);
pNewWeapon->SetThink(&CBasePlayerItem::AttemptToMaterialize); pNewWeapon->SetThink(&CBasePlayerItem::AttemptToMaterialize);