diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-12-18 01:58:09 +0100 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-12-18 01:58:09 +0100 |
commit | cfda5eb148abdb502b049083c83f166460ccc8be (patch) | |
tree | 290b84a8053f37f3b676fd26314631a528f04630 /src/weapons/Weapon.cpp | |
parent | Fix placement of some script functions (diff) | |
download | re3-cfda5eb148abdb502b049083c83f166460ccc8be.tar re3-cfda5eb148abdb502b049083c83f166460ccc8be.tar.gz re3-cfda5eb148abdb502b049083c83f166460ccc8be.tar.bz2 re3-cfda5eb148abdb502b049083c83f166460ccc8be.tar.lz re3-cfda5eb148abdb502b049083c83f166460ccc8be.tar.xz re3-cfda5eb148abdb502b049083c83f166460ccc8be.tar.zst re3-cfda5eb148abdb502b049083c83f166460ccc8be.zip |
Diffstat (limited to '')
-rw-r--r-- | src/weapons/Weapon.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index 52d95abb..2435d544 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -506,7 +506,7 @@ CWeapon::FireMelee(CEntity *shooter, CVector &fireSource) if ( victimPed->bUsesCollision || victimPed->Dead() || victimPed->Driving() ) { CVector victimPedPos = victimPed->GetPosition(); - if ( SQR(victimPedRadius) > (victimPedPos-(*fireSource)).MagnitudeSqr() ) + if ( SQR(victimPedRadius) > (victimPedPos-fireSource).MagnitudeSqr() ) { CVector collisionDist; CColModel* victimPedCol = &CTempColModels::ms_colModelPed1; @@ -528,9 +528,9 @@ CWeapon::FireMelee(CEntity *shooter, CVector &fireSource) CColSphere *sphere = &victimPedCol->spheres[s]; if (useLocalPos) - collisionDist = sphere->center - (*fireSource); + collisionDist = sphere->center - fireSource; else - collisionDist = victimPedPos + sphere->center - (*fireSource); + collisionDist = victimPedPos + sphere->center - fireSource; if ( SQR(sphere->radius + info->m_fRadius) > collisionDist.MagnitudeSqr() ) { @@ -873,7 +873,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource) CPed *threatAttack = (CPed*)shooterPed->m_pPointGunAt; if ( threatAttack->IsPed() ) { - threatAttack->m_pedIK.GetComponentPosition(*(RwV3d *)&target, PED_MID); + threatAttack->m_pedIK.GetComponentPosition(target, PED_MID); threatAttack->ReactToPointGun(shooter); } else @@ -1703,7 +1703,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource) { CVector pos; if (shooterPed->m_pPointGunAt->IsPed()) { - ((CPed*)shooterPed->m_pPointGunAt)->m_pedIK.GetComponentPosition(*(RwV3d *)&pos, PED_MID); + ((CPed*)shooterPed->m_pPointGunAt)->m_pedIK.GetComponentPosition(pos, PED_MID); } else { pos = ((CPed*)shooterPed->m_pPointGunAt)->GetPosition(); } @@ -2167,7 +2167,7 @@ CWeapon::LaserScopeDot(CVector *pOutPos, float *pOutSize) CVector pos = foundCol.point; float w, h; - if ( CSprite::CalcScreenCoors(foundCol.point, pos, &w, &h, true) ) + if ( CSprite::CalcScreenCoors(foundCol.point, &pos, &w, &h, true) ) { *pOutPos = pos; *pOutSize = w * 0.05f; @@ -2262,7 +2262,7 @@ CWeapon::TakePhotograph(CEntity *shooter) CVector pos; float w, h; - if ( CSprite::CalcScreenCoors(pedPos, pos, &w, &h, false) ) + if ( CSprite::CalcScreenCoors(pedPos, &pos, &w, &h, false) ) { if ( SCREEN_WIDTH * 0.1f < pos.x && SCREEN_WIDTH * 0.9f > pos.x && SCREEN_HEIGHT * 0.1f < pos.y && SCREEN_HEIGHT * 0.9f > pos.y ) |