Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Client/mods/deathmatch/logic/CClientExplosionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ bool CClientExplosionManager::Hook_ExplosionCreation(CEntity* pGameExplodingEnti
// Determine the used weapon
eWeaponType explosionWeaponType = WEAPONTYPE_EXPLOSION;

switch (explosionType)
// Use stored weapon type if available
if (m_LastWeaponType != WEAPONTYPE_UNARMED && m_pLastCreator == pResponsible)
explosionWeaponType = m_LastWeaponType;
else
{
switch (explosionType)
{
case EXP_TYPE_GRENADE:
{
Expand All @@ -82,6 +87,7 @@ bool CClientExplosionManager::Hook_ExplosionCreation(CEntity* pGameExplodingEnti
break;
default:
break;
}
}

// Handle this explosion client side only if entity is local or breakable (i.e. barrel)
Expand Down
13 changes: 1 addition & 12 deletions Client/mods/deathmatch/logic/CClientPed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4979,18 +4979,7 @@ void CClientPed::DestroySatchelCharges(bool bBlow, bool bDestroy)
if (bBlow)
{
pProjectile->GetPosition(vecPosition);
CLuaArguments Arguments;
Arguments.PushNumber(vecPosition.fX);
Arguments.PushNumber(vecPosition.fY);
Arguments.PushNumber(vecPosition.fZ);
Arguments.PushNumber(EXP_TYPE_GRENADE);
bool bCancelExplosion = !CallEvent("onClientExplosion", Arguments, true);

if (!bCancelExplosion)
{
m_pManager->GetExplosionManager()->Create(EXP_TYPE_GRENADE, vecPosition, this, true, -1.0f, false, WEAPONTYPE_REMOTE_SATCHEL_CHARGE);
g_pClientGame->SendExplosionSync(vecPosition, EXP_TYPE_GRENADE, this);
}
m_pManager->GetExplosionManager()->Create(EXP_TYPE_GRENADE, vecPosition, this, true, -1.0f, false, WEAPONTYPE_REMOTE_SATCHEL_CHARGE);
}
if (bDestroy)
{
Expand Down