Skip to content

Commit 5ffb8cd

Browse files
committed
fix: fix onBlockExplode
1 parent a107fec commit 5ffb8cd

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

src/lse/events/EventHooks.cpp

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -594,48 +594,48 @@ LL_TYPE_INSTANCE_HOOK(PlayerEatHook, HookPriority::Normal, Player, &Player::eat,
594594
LL_TYPE_INSTANCE_HOOK(ExplodeHook, HookPriority::Normal, Level, &Level::$explode, bool, ::Explosion& explosion) {
595595
// Todo: broken need to be fixed
596596

597-
// IF_LISTENED(EVENT_TYPES::onEntityExplode) {
598-
// if (explosion.mUnka79c6e.as<ActorUniqueID>().rawID != ActorUniqueID::INVALID_ID().rawID) {
599-
// if (!CallEvent(
600-
// EVENT_TYPES::onEntityExplode,
601-
// EntityClass::newEntity(
602-
// ll::service::getLevel()->fetchEntity(explosion.mUnka79c6e.as<ActorUniqueID>(), false)
603-
// ),
604-
// FloatPos::newPos(
605-
// explosion.mUnkcbb3c1.as<Vec3>(),
606-
// explosion.mUnk2a21f8.as<BlockSource>().getDimensionId()
607-
// ),
608-
// Number::newNumber(explosion.mUnk304b6b.as<float>()),
609-
// Number::newNumber(explosion.mUnk62d2a5.as<float>()),
610-
// Boolean::newBoolean(explosion.mUnke8bdf7.as<bool>()),
611-
// Boolean::newBoolean(explosion.mUnk501acf.as<bool>())
612-
// )) {
613-
// return false;
614-
// }
615-
// }
616-
// }
617-
// IF_LISTENED_END(EVENT_TYPES::onEntityExplode);
618-
//
619-
// IF_LISTENED(EVENT_TYPES::onBlockExplode) {
620-
// if (!CallEvent(
621-
// EVENT_TYPES::onBlockExplode,
622-
// BlockClass::newBlock(
623-
// explosion.mUnkcbb3c1.as<Vec3>(),
624-
// explosion.mUnk2a21f8.as<BlockSource>().getDimensionId()
625-
// ),
626-
// FloatPos::newPos(
627-
// explosion.mUnkcbb3c1.as<Vec3>(),
628-
// explosion.mUnk2a21f8.as<BlockSource>().getDimensionId()
629-
// ),
630-
// Number::newNumber(explosion.mUnk304b6b.as<float>()),
631-
// Number::newNumber(explosion.mUnk62d2a5.as<float>()),
632-
// Boolean::newBoolean(explosion.mUnke8bdf7.as<bool>()),
633-
// Boolean::newBoolean(explosion.mUnk501acf.as<bool>())
634-
// )) {
635-
// return false;
636-
// }
637-
// }
638-
// IF_LISTENED_END(EVENT_TYPES::onBlockExplode);
597+
IF_LISTENED(EVENT_TYPES::onEntityExplode) {
598+
if (explosion.mUnka79c6e.as<ActorUniqueID>().rawID != ActorUniqueID::INVALID_ID().rawID) {
599+
if (!CallEvent(
600+
EVENT_TYPES::onEntityExplode,
601+
EntityClass::newEntity(
602+
ll::service::getLevel()->fetchEntity(explosion.mUnka79c6e.as<ActorUniqueID>(), false)
603+
),
604+
FloatPos::newPos(
605+
explosion.mUnkcbb3c1.as<Vec3>(),
606+
explosion.mUnk2a21f8.as<BlockSource*>()->getDimensionId()
607+
),
608+
Number::newNumber(explosion.mUnk304b6b.as<float>()),
609+
Number::newNumber(explosion.mUnk62d2a5.as<float>()),
610+
Boolean::newBoolean(explosion.mUnke8bdf7.as<bool>()),
611+
Boolean::newBoolean(explosion.mUnk501acf.as<bool>())
612+
)) {
613+
return false;
614+
}
615+
}
616+
}
617+
IF_LISTENED_END(EVENT_TYPES::onEntityExplode);
618+
619+
IF_LISTENED(EVENT_TYPES::onBlockExplode) {
620+
if (!CallEvent(
621+
EVENT_TYPES::onBlockExplode,
622+
BlockClass::newBlock(
623+
explosion.mUnkcbb3c1.as<Vec3>(),
624+
explosion.mUnk2a21f8.as<BlockSource*>()->getDimensionId()
625+
),
626+
FloatPos::newPos(
627+
explosion.mUnkcbb3c1.as<Vec3>(),
628+
explosion.mUnk2a21f8.as<BlockSource*>()->getDimensionId()
629+
),
630+
Number::newNumber(explosion.mUnk304b6b.as<float>()),
631+
Number::newNumber(explosion.mUnk62d2a5.as<float>()),
632+
Boolean::newBoolean(explosion.mUnke8bdf7.as<bool>()),
633+
Boolean::newBoolean(explosion.mUnk501acf.as<bool>())
634+
)) {
635+
return false;
636+
}
637+
}
638+
IF_LISTENED_END(EVENT_TYPES::onBlockExplode);
639639
return origin(explosion);
640640
}
641641

0 commit comments

Comments
 (0)