summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
Diffstat (limited to 'src/control')
-rw-r--r--src/control/Pickups.cpp16
-rw-r--r--src/control/Pickups.h1
-rw-r--r--src/control/Script.cpp2
-rw-r--r--src/control/Script.h1
4 files changed, 18 insertions, 2 deletions
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index 3d76fe5b..e53f1ecb 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -369,7 +369,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
if (weaponType < WEAPONTYPE_TOTALWEAPONS && CDarkel::FrenzyOnGoing()) {
isPickupTouched = false;
m_bWasControlMessageShown = false;
- } else if (weaponType != WEAPONTYPE_UNARMED) {
+ } else if (weaponType < WEAPONTYPE_TOTALWEAPONS && weaponType != WEAPONTYPE_UNARMED) {
uint32 slot = CWeaponInfo::GetWeaponInfo(weaponType)->m_nWeaponSlot;
eWeaponType plrWeaponSlot = FindPlayerPed()->GetWeapon(slot).m_eWeaponType;
if (plrWeaponSlot != weaponType) {
@@ -1412,6 +1412,20 @@ CPickups::DetonateMinesHitByGunShot(CVector *vec1, CVector *vec2)
}
void
+CPickups::RemoveUnnecessaryPickups(const CVector& center, float radius)
+{
+ for (int i = 0; i < NUMPICKUPS; i++) {
+ if (aPickUps[i].m_eType == PICKUP_ONCE_TIMEOUT || aPickUps[i].m_eType == PICKUP_MONEY) {
+ if (Distance(center, aPickUps[i].m_vecPos) < radius) {
+ aPickUps[i].GetRidOfObjects();
+ aPickUps[i].m_bRemoved = true;
+ aPickUps[i].m_eType = PICKUP_NONE;
+ }
+ }
+ }
+}
+
+void
CPickups::Load(uint8 *buf, uint32 size)
{
INITSAVEBUF
diff --git a/src/control/Pickups.h b/src/control/Pickups.h
index e48ae3b7..36179f66 100644
--- a/src/control/Pickups.h
+++ b/src/control/Pickups.h
@@ -103,6 +103,7 @@ public:
static bool TryToMerge_WeaponType(CVector pos, eWeaponType weapon, uint8 type, uint32 quantity, bool unused);
static void CreateSomeMoney(CVector, int);
static void DetonateMinesHitByGunShot(CVector *vec1, CVector *vec2);
+ static void RemoveUnnecessaryPickups(const CVector& center, float radius);
static void Load(uint8 *buf, uint32 size);
static void Save(uint8 *buf, uint32 *size);
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 6aa314f2..10dee77d 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -11232,7 +11232,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
CollectParameters(&m_nIp, 2);
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
script_assert(pPed);
- pPed->bNoCriticalHits = (ScriptParams[0] == 0);
+ pPed->bNoCriticalHits = (ScriptParams[1] == 0);
return 0;
}
/*
diff --git a/src/control/Script.h b/src/control/Script.h
index c63025b2..c6ece50f 100644
--- a/src/control/Script.h
+++ b/src/control/Script.h
@@ -381,6 +381,7 @@ private:
public:
static void RemoveThisPed(CPed* pPed);
+ static uint32& GetLastMissionPassedTime() { return LastMissionPassedTime; }
#ifdef MISSION_SWITCHER
static void SwitchToMission(int32 mission);
#endif