Skip to content

Commit

Permalink
Little changes
Browse files Browse the repository at this point in the history
  • Loading branch information
FileEX committed Dec 24, 2024
1 parent 6ae2eb7 commit 305ceb7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Client/game_sa/CPedSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,15 +549,17 @@ void CPedSA::SetOxygenLevel(float oxygen)
void CPedSA::GetAttachedSatchels(std::vector<SSatchelsData>& satchelsList) const
{
// Array of projectiles objects
CProjectileSAInterface** projectilesArray = (CProjectileSAInterface**)ARRAY_CProjectile;
CProjectileSAInterface* projectileInterface;
auto** projectilesArray = reinterpret_cast<CProjectileSAInterface**>(ARRAY_CProjectile);
CProjectileSAInterface* projectileInterface = nullptr;

// Array of projectiles infos
CProjectileInfoSAInterface* projectilesInfoArray = (CProjectileInfoSAInterface*)ARRAY_CProjectileInfo;
CProjectileInfoSAInterface* projectileInfoInterface;
auto* projectilesInfoArray = reinterpret_cast<CProjectileInfoSAInterface*>(ARRAY_CProjectileInfo);
CProjectileInfoSAInterface* projectileInfoInterface = nullptr;

satchelsList.reserve(PROJECTILE_COUNT);

// Loop through all projectiles
for (std::uint8_t i = 0; i < PROJECTILE_COUNT; i++)
for (std::size_t i = 0; i < PROJECTILE_COUNT; i++)
{
projectileInterface = projectilesArray[i];

Expand All @@ -573,7 +575,7 @@ void CPedSA::GetAttachedSatchels(std::vector<SSatchelsData>& satchelsList) const
continue;

// Push satchel into the array. There is no need to check the counter because for satchels it restarts until the player detonates the charges
satchelsList.push_back({projectileInterface, &projectileInterface->m_vecAttachedOffset, &projectileInterface->m_vecAttachedRotation});
satchelsList.emplace_back(projectileInterface, &projectileInterface->m_vecAttachedOffset, &projectileInterface->m_vecAttachedRotation);
}
}

Expand Down
2 changes: 2 additions & 0 deletions Client/sdk/game/CPed.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ struct SSatchelsData
CProjectileSAInterface* pProjectileInterface;
CVector* vecAttachedOffsets;
CVector* vecAttachedRotation;

SSatchelsData(CProjectileSAInterface* proj, CVector* offset, CVector* rotation) : pProjectileInterface(proj), vecAttachedOffsets(offset), vecAttachedRotation(rotation) {}
};

inline bool IsValidMoveAnim(std::uint32_t iMoveAnim) noexcept
Expand Down

0 comments on commit 305ceb7

Please sign in to comment.