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 cf8deb9cac (r92242848)

Co-authored-by: Vaqtincha <51029683+Vaqtincha@users.noreply.github.com>
This commit is contained in:
Sergey Shorokhov 2022-12-15 16:06:08 +03:00 committed by GitHub
parent 980162774a
commit ab2bfd4b9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -150,7 +150,7 @@ void CFuncVehicle::Blocked(CBaseEntity *pOther)
if (pOther->Classify() == CLASS_PLAYER) if (pOther->Classify() == CLASS_PLAYER)
{ {
CBasePlayer* playerOther = static_cast<CBasePlayer*>(pOther); CBasePlayer* playerOther = static_cast<CBasePlayer*>(pOther);
if (!playerDriver || (!friendlyfire.value && playerDriver->m_iTeam == playerOther->m_iTeam)) if (!playerDriver || g_pGameRules->PlayerRelationship(playerDriver, playerOther) == GR_TEAMMATE)
{ {
// Just kick player // Just kick player
return; return;

View File

@ -70,6 +70,8 @@ float GetBaseAccuracy(WeaponIdType id)
case WEAPON_MP5N: case WEAPON_MP5N:
return 0.0f; return 0.0f;
} }
return 0.0f;
} }
// Resets the global multi damage accumulator // Resets the global multi damage accumulator