From ab2bfd4b9d4549ee78d79e32edb41045b5927fea Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Thu, 15 Dec 2022 16:06:08 +0300 Subject: [PATCH] little code fixes (#798) * weapons.cpp fix compile warning `warning C4715: 'GetBaseAccuracy': not all control paths return a value` * vihicle.cpp: use PlayerRelationship() thanks to https://github.com/s1lentq/ReGameDLL_CS/commit/cf8deb9cacea9aad868183ef90206135825e8e2e#r92242848 Co-authored-by: Vaqtincha <51029683+Vaqtincha@users.noreply.github.com> --- regamedll/dlls/vehicle.cpp | 2 +- regamedll/dlls/weapons.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/vehicle.cpp b/regamedll/dlls/vehicle.cpp index ffd0bc55..3089c916 100644 --- a/regamedll/dlls/vehicle.cpp +++ b/regamedll/dlls/vehicle.cpp @@ -150,7 +150,7 @@ void CFuncVehicle::Blocked(CBaseEntity *pOther) if (pOther->Classify() == CLASS_PLAYER) { CBasePlayer* playerOther = static_cast(pOther); - if (!playerDriver || (!friendlyfire.value && playerDriver->m_iTeam == playerOther->m_iTeam)) + if (!playerDriver || g_pGameRules->PlayerRelationship(playerDriver, playerOther) == GR_TEAMMATE) { // Just kick player return; diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index 22d61fc9..2d2b5afc 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -70,6 +70,8 @@ float GetBaseAccuracy(WeaponIdType id) case WEAPON_MP5N: return 0.0f; } + + return 0.0f; } // Resets the global multi damage accumulator