diff options
author | aap <aap@papnet.eu> | 2020-12-18 13:50:37 +0100 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-12-18 13:50:37 +0100 |
commit | 55cf1a37cbce81db5b32264cfb4ebfa0a9793017 (patch) | |
tree | 9273d77a5fdffc4bc70cf7439fedb7935da024d6 /src/weapons | |
parent | little cleanup and synch on templates and config (diff) | |
parent | Merge pull request #889 from aap/miami (diff) | |
download | re3-55cf1a37cbce81db5b32264cfb4ebfa0a9793017.tar re3-55cf1a37cbce81db5b32264cfb4ebfa0a9793017.tar.gz re3-55cf1a37cbce81db5b32264cfb4ebfa0a9793017.tar.bz2 re3-55cf1a37cbce81db5b32264cfb4ebfa0a9793017.tar.lz re3-55cf1a37cbce81db5b32264cfb4ebfa0a9793017.tar.xz re3-55cf1a37cbce81db5b32264cfb4ebfa0a9793017.tar.zst re3-55cf1a37cbce81db5b32264cfb4ebfa0a9793017.zip |
Diffstat (limited to 'src/weapons')
-rw-r--r-- | src/weapons/Explosion.cpp | 2 | ||||
-rw-r--r-- | src/weapons/Weapon.cpp | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/weapons/Explosion.cpp b/src/weapons/Explosion.cpp index 515dff94..38ce6e53 100644 --- a/src/weapons/Explosion.cpp +++ b/src/weapons/Explosion.cpp @@ -220,7 +220,7 @@ CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionT } else if (veh->IsComponentPresent(CAR_BOOT)) { veh->GetComponentWorldPosition(CAR_BOOT, componentPos); } - if (componentPos != nil) { + if (componentPos.x != 0.0f) { int rn = (CGeneral::GetRandomNumber() & 1) + 1; for (int i = 0; i < rn; i++) CParticle::AddJetExplosion(componentPos, (CGeneral::GetRandomNumber() & 7) / 7.0f + 1.5f, 0.5f); 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 ) |