summaryrefslogtreecommitdiffstats
path: root/src/objects
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/objects/ObjectData.cpp2
-rw-r--r--src/objects/Projectile.cpp14
-rw-r--r--src/objects/Projectile.h1
3 files changed, 16 insertions, 1 deletions
diff --git a/src/objects/ObjectData.cpp b/src/objects/ObjectData.cpp
index 775a87a1..92e9d544 100644
--- a/src/objects/ObjectData.cpp
+++ b/src/objects/ObjectData.cpp
@@ -57,7 +57,7 @@ CObjectData::Initialise(const char *filename)
&ms_aObjectInfo[id].m_fCollisionDamageMultiplier,
&damageEffect, &responseCase, &camAvoid);
- ms_aObjectInfo[id].m_fBuoyancy = 100.0f/percentSubmerged * 0.008*ms_aObjectInfo[id].m_fMass;
+ ms_aObjectInfo[id].m_fBuoyancy = 100.0f/percentSubmerged * GRAVITY *ms_aObjectInfo[id].m_fMass;
ms_aObjectInfo[id].m_nCollisionDamageEffect = damageEffect;
ms_aObjectInfo[id].m_nSpecialCollisionResponseCases = responseCase;
ms_aObjectInfo[id].m_bCameraToAvoidThisObject = camAvoid;
diff --git a/src/objects/Projectile.cpp b/src/objects/Projectile.cpp
index c6c2d6e1..38bbfdfa 100644
--- a/src/objects/Projectile.cpp
+++ b/src/objects/Projectile.cpp
@@ -2,12 +2,26 @@
#include "patcher.h"
#include "Projectile.h"
+CProjectile::CProjectile(int32 model) : CObject()
+{
+ m_fMass = 1.0f;
+ m_fTurnMass = 1.0f;
+ m_fAirResistance = 0.99f;
+ m_fElasticity = 0.75f;
+ m_fBuoyancy = GRAVITY * m_fMass * 0.1f;
+ bExplosionProof = true;
+ SetModelIndex(model);
+ ObjectCreatedBy = MISSION_OBJECT;
+}
+
class CProjectile_ : public CProjectile
{
public:
+ CProjectile* ctor(int32 model) { return ::new (this) CProjectile(model); }
void dtor(void) { CProjectile::~CProjectile(); }
};
STARTPATCHES
+ InjectHook(0x4BFE30, &CProjectile_::ctor, PATCH_JUMP);
InjectHook(0x4BFED0, &CProjectile_::dtor, PATCH_JUMP);
ENDPATCHES
diff --git a/src/objects/Projectile.h b/src/objects/Projectile.h
index 4d5041f8..2f2b541c 100644
--- a/src/objects/Projectile.h
+++ b/src/objects/Projectile.h
@@ -7,4 +7,5 @@
class CProjectile : public CObject
{
public:
+ CProjectile(int32);
};