MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / HitTarget

Function HitTarget

TombEngine/Game/Lara/lara_fire.cpp:1198–1218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1196}
1197
1198void HitTarget(ItemInfo* laraItem, ItemInfo* targetEntity, GameVector* hitPos, int damage, bool isExplosive, int bestJointIndex)
1199{
1200 const auto& object = Objects[targetEntity->ObjectNumber];
1201
1202 targetEntity->HitStatus = true;
1203 if (targetEntity->IsCreature())
1204 GetCreatureInfo(targetEntity)->HurtByLara = true;
1205
1206 if (object.HitRoutine == nullptr)
1207 return;
1208
1209 if (hitPos != nullptr)
1210 {
1211 hitPos->RoomNumber = targetEntity->RoomNumber;
1212 object.HitRoutine(*targetEntity, *laraItem, *hitPos, damage, isExplosive, bestJointIndex);
1213 }
1214 else
1215 {
1216 object.HitRoutine(*targetEntity, *laraItem, std::nullopt, damage, isExplosive, bestJointIndex);
1217 }
1218}
1219
1220void SmashItem(short itemNumber)
1221{

Callers 4

GetTargetOnLOSFunction · 0.85
FireWeaponFunction · 0.85
DoExplosiveDamageFunction · 0.85
HandleProjectileFunction · 0.85

Calls 2

GetCreatureInfoFunction · 0.85
IsCreatureMethod · 0.80

Tested by

no test coverage detected