MCPcopy Create free account
hub / github.com/Norbyte/ositools / HitPrepare

Function HitPrepare

OsiInterface/Functions/DamageFunctions.cpp:415–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413 namespace func
414 {
415 bool HitPrepare(OsiArgumentDesc & args)
416 {
417 auto targetGuid = args[0].String;
418 auto sourceGuid = args[1].String;
419 auto & helperHandle = args[2].Int64;
420
421 auto target = FindGameObjectByNameGuid(targetGuid);
422 if (target == nullptr) {
423 OsiError("Target '" << targetGuid << "' doesn't exist!");
424 return false;
425 }
426
427 auto helper = gOsirisProxy->GetExtensionState().DamageHelpers.Create();
428 helper->Type = DamageHelpers::HT_CustomHit;
429 helper->Target = target;
430 helper->Source = FindCharacterByNameGuid(sourceGuid);
431 helper->SetInternalDamageInfo();
432
433 helperHandle = helper->Handle;
434 return true;
435 }
436
437 DamageHelpers * HelperHandleToHelper(int64_t handle)
438 {

Callers

nothing calls this directly

Calls 4

FindGameObjectByNameGuidFunction · 0.85
FindCharacterByNameGuidFunction · 0.85
SetInternalDamageInfoMethod · 0.80
CreateMethod · 0.45

Tested by

no test coverage detected