| 207 | } |
| 208 | |
| 209 | void HitCorpse(ItemInfo& target, ItemInfo& source, std::optional<GameVector> pos, int damage, bool isExplosive, int jointIndex) |
| 210 | { |
| 211 | const auto& object = Objects[target.ObjectNumber]; |
| 212 | const auto& player = *GetLaraInfo(&source); |
| 213 | |
| 214 | if (pos.has_value() && (player.Control.Weapon.GunType == LaraWeaponType::Pistol || |
| 215 | player.Control.Weapon.GunType == LaraWeaponType::Shotgun || |
| 216 | player.Control.Weapon.GunType == LaraWeaponType::Uzi || |
| 217 | player.Control.Weapon.GunType == LaraWeaponType::HK || |
| 218 | player.Control.Weapon.GunType == LaraWeaponType::Revolver)) |
| 219 | { |
| 220 | DoBloodSplat(pos->x, pos->y, pos->z, Random::GenerateInt(4, 8), source.Pose.Orientation.y, pos->RoomNumber); |
| 221 | |
| 222 | if (target.ItemFlags[7] == (int)CorpseFlag::Hang) |
| 223 | { |
| 224 | target.ItemFlags[7] = (int)CorpseFlag::Fall; |
| 225 | target.Animation.AnimNumber = CORPSE_ANIM_FALL; |
| 226 | target.Animation.ActiveState = CORPSE_STATE_FALL; |
| 227 | } |
| 228 | } |
| 229 | else if (player.Weapons[(int)LaraWeaponType::GrenadeLauncher].SelectedAmmo == WeaponAmmoType::Ammo2) |
| 230 | { |
| 231 | DoItemHit(&target,0, isExplosive, false); |
| 232 | } |
| 233 | else |
| 234 | { |
| 235 | DoItemHit(&target, 0, isExplosive, false); |
| 236 | } |
| 237 | } |
| 238 | } |
nothing calls this directly
no test coverage detected