summaryrefslogtreecommitdiffstats
path: root/src/weapons
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-06-02 23:34:53 +0200
committeraap <aap@papnet.eu>2020-06-02 23:34:53 +0200
commit04a91761df7c90ed16b37407d65d8674033efd3f (patch)
treea5df11d9e0afee0c6ca376a214fd6cbdc65f58cf /src/weapons
parentrenamed a vehicle thing (diff)
downloadre3-04a91761df7c90ed16b37407d65d8674033efd3f.tar
re3-04a91761df7c90ed16b37407d65d8674033efd3f.tar.gz
re3-04a91761df7c90ed16b37407d65d8674033efd3f.tar.bz2
re3-04a91761df7c90ed16b37407d65d8674033efd3f.tar.lz
re3-04a91761df7c90ed16b37407d65d8674033efd3f.tar.xz
re3-04a91761df7c90ed16b37407d65d8674033efd3f.tar.zst
re3-04a91761df7c90ed16b37407d65d8674033efd3f.zip
Diffstat (limited to 'src/weapons')
-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 93481105..378e621a 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"
@@ -1631,31 +1632,29 @@ CWeapon::FireInstantHitFromCar(CAutomobile *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