File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 88#include " ll/api/service/Bedrock.h"
99#include " ll/api/service/GamingStatus.h"
1010#include " mc/common/Globals.h"
11+ #include " mc/deps/ecs/gamerefs_entity/EntityContext.h"
1112#include " mc/deps/shared_types/legacy/actor/ActorDamageCause.h"
1213#include " mc/entity/components_json_legacy/NpcComponent.h"
1314#include " mc/entity/components_json_legacy/ProjectileComponent.h"
@@ -280,7 +281,6 @@ LL_TYPE_INSTANCE_HOOK(
280281 return origin (source, damage);
281282}
282283
283- // TODO: fix this event, can't get correct vector via mUnke14f11
284284LL_TYPE_INSTANCE_HOOK (
285285 NpcCommandHook,
286286 HookPriority::Normal,
@@ -294,9 +294,10 @@ LL_TYPE_INSTANCE_HOOK(
294294) {
295295 IF_LISTENED (EVENT_TYPES::onNpcCmd) {
296296 auto & action =
297- mActionsContainer ->mUnke14f11 .as <std::vector<std::variant<npc::CommandAction, npc::UrlAction>>>().at (
298- actionIndex
299- );
297+ owner.getEntityContext ()
298+ .tryGetComponent <NpcComponent>()
299+ ->mActionsContainer ->mUnke14f11 .as <std::vector<std::variant<npc::CommandAction, npc::UrlAction>>>()
300+ .at (actionIndex);
300301 if (std::holds_alternative<npc::CommandAction>(action)) {
301302 auto & commands = std::get<npc::CommandAction>(action).commands ;
302303 std::string command;
You can’t perform that action at this time.
0 commit comments