Merge branch 'master' into chatter-fixes-and-improvements

This commit is contained in:
Владислав Сухов 2024-05-07 09:15:48 +00:00
commit 9e24eb6be4
15 changed files with 852 additions and 850 deletions

1
.gitattributes vendored
View file

@ -1,5 +1,6 @@
# Auto detect text files and perform LF normalization
* text=lf
* text eol=lf
# Custom for Visual Studio
*.sln merge=union

View file

@ -475,7 +475,7 @@ void Bot::updatePickups () {
else if (m_healthValue >= 100.0f && model == "medkit.mdl") {
allowPickup = false;
}
else if (pev->armorvalue >= 100.0f && (model == "kevlar.mdl"|| model == "battery.mdl" || model == "assault.mdl")) {
else if (pev->armorvalue >= 100.0f && (model == "kevlar.mdl" || model == "battery.mdl" || model == "assault.mdl")) {
allowPickup = false;
}
else if ((pev->weapons & cr::bit (Weapon::Flashbang)) && model == kFlashbangModelName) {

View file

@ -550,7 +550,7 @@ Vector Bot::getBodyOffsetError (float distance) {
m_aimLastError = Vector (rg (mins.x * hitError, maxs.x * hitError), rg (mins.y * hitError, maxs.y * hitError), rg (mins.z * hitError * 0.5f, maxs.z * hitError * 0.5f));
const auto &aimError = conf.getDifficultyTweaks (m_difficulty) ->aimError;
const auto &aimError = conf.getDifficultyTweaks (m_difficulty)->aimError;
m_aimLastError += Vector (rg (-aimError.x, aimError.x), rg (-aimError.y, aimError.y), rg (-aimError.z, aimError.z));
m_aimErrorTime = game.time () + rg (0.4f, 0.8f);
@ -661,7 +661,7 @@ Vector Bot::getCustomHeight (float distance) {
{ 0.0f, 0.0f, 0.0f }, // melee
{ 0.5f, -0.1f, -1.5f }, // pistol
{ 6.5f, 6.0f, -2.0f }, // shotgun
{ 0.5f -7.5f, -9.5f }, // zoomrifle
{ 0.5f - 7.5f, -9.5f }, // zoomrifle
{ 0.5f, -7.5f, -9.5f }, // rifle
{ 0.5f, -7.5f, -9.5f }, // smg
{ 0.0f, -2.5f, -6.0f }, // sniper
@ -2201,7 +2201,8 @@ void Bot::checkGrenadesThrow () {
}
break;
case Weapon::Flashbang: {
case Weapon::Flashbang:
{
const int nearest = graph.getNearest (m_lastEnemy->v.velocity.get2d () + m_lastEnemy->v.origin);
if (nearest != kInvalidNodeIndex) {

View file

@ -1527,7 +1527,7 @@ void BotGraph::syncInitLightLevels () {
// update light levels for all nodes
for (auto &path : m_paths) {
path.light = illum.getLightLevel (path.origin + Vector { 0.0f, 0.0f, 16.0f} );
path.light = illum.getLightLevel (path.origin + Vector { 0.0f, 0.0f, 16.0f });
}
m_lightChecked = true;

View file

@ -34,7 +34,7 @@ plugin_info_t Plugin_info = {
// compilers can't create lambdas with vaargs, so put this one in it's own namespace
namespace Hooks {
void handler_engClientCommand (edict_t *ent, char const *format, ...) {
void handler_engClientCommand (edict_t *ent, char const *format, ...) {
// this function forces the client whose player entity is ent to issue a client command.
// How it works is that clients all have a argv global string in their client DLL that
// stores the command string; if ever that string is filled with characters, the client DLL
@ -70,7 +70,7 @@ namespace Hooks {
va_end (ap);
engfuncs.pfnClientCommand (ent, buffer);
}
}
}
CR_EXPORT int GetEntityAPI (gamefuncs_t *table, int interfaceVersion) {
@ -488,7 +488,7 @@ CR_LINKAGE_C int GetEngineFunctions (enginefuncs_t *table, int *) {
}
if (entlink.needsBypass () && !game.is (GameFlags::Metamod)) {
table->pfnCreateNamedEntity = [] (string_t classname) -> edict_t *{
table->pfnCreateNamedEntity = [] (string_t classname) -> edict_t * {
if (entlink.isPaused ()) {
entlink.enable ();

View file

@ -944,7 +944,7 @@ void Bot::defuseBomb_ () {
if (m_isReloading && bombPos.distanceSq2d (pev->origin) < cr::sqrf (80.0f)) {
if (m_numEnemiesLeft == 0
|| timeToBlowUp < fullDefuseTime + 7.0f
|| ((getAmmoInClip () > 8 && m_reloadState == Reload::Primary)|| (getAmmoInClip () > 5 && m_reloadState == Reload::Secondary))) {
|| ((getAmmoInClip () > 8 && m_reloadState == Reload::Primary) || (getAmmoInClip () > 5 && m_reloadState == Reload::Secondary))) {
const int weaponIndex = bestWeaponCarried ();