Only shatter harpoons if no intelligent target was hit

This commit is contained in:
Lwmte 2021-12-24 15:47:53 +03:00
parent 3acd7d9e31
commit c39c125570

View file

@ -180,6 +180,7 @@ void HarpoonBoltControl(short itemNumber)
int n = 0; int n = 0;
bool foundCollidedObjects = false; bool foundCollidedObjects = false;
bool explodeItem = true;
// Found possible collided items and statics // Found possible collided items and statics
GetCollidedObjects(item, HARPOON_HIT_RADIUS, 1, &CollidedItems[0], &CollidedMeshes[0], 1); GetCollidedObjects(item, HARPOON_HIT_RADIUS, 1, &CollidedItems[0], &CollidedMeshes[0], 1);
@ -201,7 +202,10 @@ void HarpoonBoltControl(short itemNumber)
foundCollidedObjects = true; foundCollidedObjects = true;
if (currentObj->intelligent && currentObj->collision && currentItem->status == ITEM_ACTIVE && !currentObj->undead) if (currentObj->intelligent && currentObj->collision && currentItem->status == ITEM_ACTIVE && !currentObj->undead)
{
explodeItem = false;
HitTarget(LaraItem, currentItem, (GAME_VECTOR*)&item->pos, Weapons[WEAPON_HARPOON_GUN].damage, 0); HitTarget(LaraItem, currentItem, (GAME_VECTOR*)&item->pos, Weapons[WEAPON_HARPOON_GUN].damage, 0);
}
// All other items (like puzzles) can't be hit // All other items (like puzzles) can't be hit
k++; k++;
@ -243,6 +247,7 @@ void HarpoonBoltControl(short itemNumber)
// If harpoon has hit some objects then shatter itself // If harpoon has hit some objects then shatter itself
if (foundCollidedObjects) if (foundCollidedObjects)
{ {
if (explodeItem)
ExplodeItemNode(item, 0, 0, EXPLODE_NORMAL); ExplodeItemNode(item, 0, 0, EXPLODE_NORMAL);
KillItem(itemNumber); KillItem(itemNumber);
} }