summaryrefslogtreecommitdiffstats
path: root/src/weapons
diff options
context:
space:
mode:
Diffstat (limited to 'src/weapons')
-rw-r--r--src/weapons/Explosion.cpp8
-rw-r--r--src/weapons/Explosion.h6
-rw-r--r--src/weapons/Weapon.cpp32
3 files changed, 44 insertions, 2 deletions
diff --git a/src/weapons/Explosion.cpp b/src/weapons/Explosion.cpp
index 078f01fa..7683ed97 100644
--- a/src/weapons/Explosion.cpp
+++ b/src/weapons/Explosion.cpp
@@ -102,7 +102,11 @@ CExplosion::GetExplosionPosition(uint8 id)
}
bool
+#ifdef SIMPLER_MISSIONS
+CExplosion::AddExplosion(CEntity* explodingEntity, CEntity* culprit, eExplosionType type, const CVector& pos, uint32 lifetime, bool makeSound, float radius)
+#else
CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime, bool makeSound)
+#endif
{
CVector pPosn;
CVector posGround;
@@ -150,7 +154,11 @@ CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionT
switch (type)
{
case EXPLOSION_GRENADE:
+#ifdef SIMPLER_MISSIONS
+ explosion.m_fRadius = (radius == -1.0f ? 9.0f : radius);
+#else
explosion.m_fRadius = 9.0f;
+#endif
explosion.m_fPower = 300.0f;
explosion.m_fStopTime = lifetime + CTimer::GetTimeInMilliseconds() + 750;
explosion.m_fPropagationRate = 0.5f;
diff --git a/src/weapons/Explosion.h b/src/weapons/Explosion.h
index 7aa02b63..e76c99ea 100644
--- a/src/weapons/Explosion.h
+++ b/src/weapons/Explosion.h
@@ -37,7 +37,11 @@ class CExplosion
float m_fPower;
float m_fZshift;
public:
- static bool AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime, bool makeSound = true); //done(new parametr in android ver is fix for one mission)
+#ifdef SIMPLER_MISSIONS
+ static bool AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32 lifetime, bool makeSound = true, float radius = -1.0f);
+#else
+ static bool AddExplosion(CEntity* explodingEntity, CEntity* culprit, eExplosionType type, const CVector& pos, uint32 lifetime, bool makeSound = true);
+#endif
static void ClearAllExplosions(); //done
static bool DoesExplosionMakeSound(uint8 id); //done
static int8 GetExplosionActiveCounter(uint8 id); //done
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp
index 36303c2c..c0319a11 100644
--- a/src/weapons/Weapon.cpp
+++ b/src/weapons/Weapon.cpp
@@ -932,11 +932,37 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
ProcessLineOfSight(*fireSource, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, false, false);
CWorld::bIncludeBikers = false;
}
+#ifdef FIX_BUGS
+ // fix muzzleflash rotation
+ heading = CGeneral::GetAngleBetweenPoints(source.x, source.y, target.x, target.y);
+ angle = DEGTORAD(heading);
+
+ ahead = CVector2D(-Sin(angle), Cos(angle));
+ ahead.Normalise();
+#endif
}
else if ( shooter == FindPlayerPed() && TheCamera.Cams[0].Using3rdPersonMouseCam() )
{
TheCamera.Find3rdPersonCamTargetVector(info->m_fRange, *fireSource, source, target);
+#ifdef FREE_CAM
+ CPed *shooterPed = (CPed *)shooter;
+ if((shooterPed->m_pedIK.m_flags & CPedIK::GUN_POINTED_SUCCESSFULLY) == 0) {
+ target.x = info->m_fRange;
+ target.y = 0.0f;
+ target.z = 0.0f;
+ shooterPed->TransformToNode(target, PED_HANDR);
+ }
+#endif
+
+#ifdef FIX_BUGS
+ // fix muzzleflash rotation
+ heading = CGeneral::GetAngleBetweenPoints(source.x, source.y, target.x, target.y);
+ angle = DEGTORAD(heading);
+
+ ahead = CVector2D(-Sin(angle), Cos(angle));
+ ahead.Normalise();
+#endif
CWorld::bIncludeBikers = true;
CWorld::bIncludeDeadPeds = true;
CWorld::bIncludeCarTyres = true;
@@ -3137,7 +3163,11 @@ CWeapon::HitsGround(CEntity *holder, CVector *fireSource, CEntity *aimingTo)
void
CWeapon::BlowUpExplosiveThings(CEntity *thing)
{
+#ifdef FIX_BUGS
+ if ( thing && thing->IsObject() )
+#else
if ( thing )
+#endif
{
CObject *object = (CObject*)thing;
int32 mi = object->GetModelIndex();
@@ -3182,7 +3212,7 @@ bool
CPed::IsPedDoingDriveByShooting(void)
{
#ifdef FIX_BUGS
- if (FindPlayerPed() == this && CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_nWeaponSlot == 5) {
+ if (FindPlayerPed() == this && CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_nWeaponSlot == WEAPONSLOT_SUBMACHINEGUN) {
#else
if (FindPlayerPed() == this && GetWeapon()->m_eWeaponType == WEAPONTYPE_UZI) {
#endif