summaryrefslogtreecommitdiffstats
path: root/src/weapons
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-06-02 23:35:20 +0200
committeraap <aap@papnet.eu>2020-06-02 23:35:20 +0200
commit2ca3c50463eff025b9783930d112dd0c257c040e (patch)
tree1601340bc1b3d51542aad6f448f52c89badfd89d /src/weapons
parentfixed radar rendering (diff)
downloadre3-2ca3c50463eff025b9783930d112dd0c257c040e.tar
re3-2ca3c50463eff025b9783930d112dd0c257c040e.tar.gz
re3-2ca3c50463eff025b9783930d112dd0c257c040e.tar.bz2
re3-2ca3c50463eff025b9783930d112dd0c257c040e.tar.lz
re3-2ca3c50463eff025b9783930d112dd0c257c040e.tar.xz
re3-2ca3c50463eff025b9783930d112dd0c257c040e.tar.zst
re3-2ca3c50463eff025b9783930d112dd0c257c040e.zip
Diffstat (limited to '')
-rw-r--r--src/weapons/Weapon.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp
index b2ac2ad2..ee786f5f 100644
--- a/src/weapons/Weapon.cpp
+++ b/src/weapons/Weapon.cpp
@@ -25,7 +25,8 @@
#include "Stats.h"
#include "TempColModels.h"
#include "Timer.h"
-#include "Vehicle.h"
+#include "Automobile.h"
+#include "Boat.h"
#include "WaterLevel.h"
#include "WeaponInfo.h"
#include "World.h"
@@ -2056,31 +2057,29 @@ CWeapon::FireInstantHitFromCar(CVehicle *shooter, bool left)
CVehicleModelInfo *modelInfo = shooter->GetModelInfo();
- #define FRONTSEATPOS() (&(shooter->IsBoat() ? modelInfo->m_positions[BOAT_POS_FRONTSEAT] : modelInfo->m_positions[CAR_POS_FRONTSEAT]))
-
CVector source, target;
if ( left )
{
source = shooter->GetMatrix() * CVector(-shooter->GetColModel()->boundingBox.max.x + -0.2f,
- float(CGeneral::GetRandomNumber() & 255) * 0.001f + FRONTSEATPOS()->y,
- FRONTSEATPOS()->z + 0.5f);
+ float(CGeneral::GetRandomNumber() & 255) * 0.001f + modelInfo->GetFrontSeatPosn().y,
+ modelInfo->GetFrontSeatPosn().z + 0.5f);
source += CTimer::GetTimeStep() * shooter->m_vecMoveSpeed;
target = shooter->GetMatrix() * CVector(-info->m_fRange,
- FRONTSEATPOS()->y,
- FRONTSEATPOS()->z + 0.5f);
+ modelInfo->GetFrontSeatPosn().y,
+ modelInfo->GetFrontSeatPosn().z + 0.5f);
}
else
{
source = shooter->GetMatrix() * CVector(shooter->GetColModel()->boundingBox.max.x + 0.2f,
- float(CGeneral::GetRandomNumber() & 255) * 0.001f + FRONTSEATPOS()->y,
- FRONTSEATPOS()->z + 0.5f);
+ float(CGeneral::GetRandomNumber() & 255) * 0.001f + modelInfo->GetFrontSeatPosn().y,
+ modelInfo->GetFrontSeatPosn().z + 0.5f);
source += CTimer::GetTimeStep() * shooter->m_vecMoveSpeed;
target = shooter->GetMatrix() * CVector(info->m_fRange,
- FRONTSEATPOS()->y,
- FRONTSEATPOS()->z + 0.5f);
+ modelInfo->GetFrontSeatPosn().y,
+ modelInfo->GetFrontSeatPosn().z + 0.5f);
}
#undef FRONTSEATPOS