File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 4343#include " ll/api/schedule/Scheduler.h"
4444#include " ll/api/schedule/Task.h"
4545#include " ll/api/service/Bedrock.h"
46+ #include " lse/Entry.h"
4647#include " lse/events/EventHooks.h"
4748#include " main/Global.h"
4849#include " mc/entity/utilities/ActorType.h"
@@ -521,7 +522,7 @@ void EnableEventListener(int eventId) {
521522 bus.emplaceListener <ActorHurtEvent>([](ActorHurtEvent& ev) {
522523 IF_LISTENED (EVENT_TYPES::onMobHurt) {
523524 if (ev.self ().hasType (ActorType::Mob)) {
524- Actor* damageSource;
525+ std::optional< Actor*> damageSource;
525526 if (ev.source ().isEntitySource ()) {
526527 if (ev.source ().isChildEntitySource ()) {
527528 damageSource = ll::service::getLevel ()->fetchEntity (ev.source ().getEntityUniqueID ());
@@ -534,7 +535,7 @@ void EnableEventListener(int eventId) {
534535 CallEvent (
535536 EVENT_TYPES::onMobHurt,
536537 EntityClass::newEntity (&ev.self ()),
537- damageSource ? EntityClass::newEntity (damageSource) : Local<Value>(),
538+ damageSource. has_value () ? EntityClass::newEntity (damageSource. value () ) : Local<Value>(),
538539 Number::newNumber (ev.damage ()),
539540 Number::newNumber ((int )ev.source ().getCause ())
540541 );
You can’t perform that action at this time.
0 commit comments