mirror of
https://github.com/quizhizhe/LiteLoaderBDS-1.16.40.git
synced 2025-06-01 19:53:41 +00:00
修复ProjectileHitEntity
事件
This commit is contained in:
parent
84287a4e3a
commit
4097c5417f
@ -1537,20 +1537,20 @@ TInstanceHook(void, "?explode@Explosion@@QEAAXXZ",Explosion) {
|
||||
|
||||
|
||||
////////////// ProjectileHitEntity //////////////
|
||||
// TClasslessInstanceHook(void, "?onHit@ProjectileComponent@@QEAAXAEAVActor@@AEBVHitResult@@@Z",
|
||||
// Actor* item, HitResult* res) {
|
||||
// IF_LISTENED(ProjectileHitEntityEvent) {
|
||||
// Actor* to = res->getEntity();
|
||||
// if (to) {
|
||||
// ProjectileHitEntityEvent ev{};
|
||||
// ev.mTarget = to;
|
||||
// ev.mSource = item;
|
||||
// ev.call();
|
||||
// }
|
||||
// }
|
||||
// IF_LISTENED_END(ProjectileHitEntityEvent)
|
||||
// return original(this, item, res);
|
||||
// }
|
||||
TClasslessInstanceHook(void, "?onHit@ProjectileComponent@@QEAAXAEAVActor@@AEBVHitResult@@@Z",
|
||||
Actor* item, HitResult* res) {
|
||||
IF_LISTENED(ProjectileHitEntityEvent) {
|
||||
Actor* to = res->getEntity();
|
||||
if (to) {
|
||||
ProjectileHitEntityEvent ev{};
|
||||
ev.mTarget = to;
|
||||
ev.mSource = item;
|
||||
ev.call();
|
||||
}
|
||||
}
|
||||
IF_LISTENED_END(ProjectileHitEntityEvent)
|
||||
return original(this, item, res);
|
||||
}
|
||||
|
||||
|
||||
////////////// WitherBossDestroy //////////////
|
||||
|
Loading…
Reference in New Issue
Block a user