mirror of
https://github.com/GTAmodding/re3.git
synced 2025-07-15 22:54:07 +00:00
Merge pull request #246 from Sergeanur/Pools
Some CPool and CPools funcs, restoring original logic of pool lookup loops
This commit is contained in:
commit
4844b3a3f8
13 changed files with 147 additions and 51 deletions
|
@ -297,7 +297,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
|
|||
m_pObject->UpdateRwFrame();
|
||||
|
||||
bool touched = false;
|
||||
for (int32 i = CPools::GetVehiclePool()->GetSize(); i > 0; i--) { // TODO: check if i > 0 is not a R* mistake
|
||||
for (int32 i = CPools::GetVehiclePool()->GetSize()-1; i >= 0; i--) {
|
||||
CVehicle *vehicle = CPools::GetVehiclePool()->GetSlot(i);
|
||||
if (vehicle != nil && vehicle->IsSphereTouchingVehicle(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z, 1.5f)) {
|
||||
touched = true;
|
||||
|
@ -324,7 +324,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
|
|||
if (CTimer::GetTimeInMilliseconds() > m_nTimer)
|
||||
explode = true;
|
||||
else {// added else here since vehicle lookup is useless
|
||||
for (int32 i = CPools::GetVehiclePool()->GetSize(); i > 0; i--) { // TODO: check if i > 0 is not a R* mistake
|
||||
for (int32 i = CPools::GetVehiclePool()->GetSize()-1; i >= 0; i--) {
|
||||
CVehicle *vehicle = CPools::GetVehiclePool()->GetSlot(i);
|
||||
if (vehicle != nil && vehicle->IsSphereTouchingVehicle(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z, 1.5f)) {
|
||||
explode = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue