mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-09 03:58:19 +03:00
Only shatter harpoons if no intelligent target was hit
This commit is contained in:
parent
3acd7d9e31
commit
c39c125570
1 changed files with 6 additions and 1 deletions
|
@ -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,7 +247,8 @@ 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)
|
||||||
{
|
{
|
||||||
ExplodeItemNode(item, 0, 0, EXPLODE_NORMAL);
|
if (explodeItem)
|
||||||
|
ExplodeItemNode(item, 0, 0, EXPLODE_NORMAL);
|
||||||
KillItem(itemNumber);
|
KillItem(itemNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue