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 8
8
#include " ll/api/service/Bedrock.h"
9
9
#include " ll/api/service/GamingStatus.h"
10
10
#include " mc/common/Globals.h"
11
+ #include " mc/deps/ecs/gamerefs_entity/EntityContext.h"
11
12
#include " mc/deps/shared_types/legacy/actor/ActorDamageCause.h"
12
13
#include " mc/entity/components_json_legacy/NpcComponent.h"
13
14
#include " mc/entity/components_json_legacy/ProjectileComponent.h"
@@ -280,7 +281,6 @@ LL_TYPE_INSTANCE_HOOK(
280
281
return origin (source, damage);
281
282
}
282
283
283
- // TODO: fix this event, can't get correct vector via mUnke14f11
284
284
LL_TYPE_INSTANCE_HOOK (
285
285
NpcCommandHook,
286
286
HookPriority::Normal,
@@ -294,9 +294,10 @@ LL_TYPE_INSTANCE_HOOK(
294
294
) {
295
295
IF_LISTENED (EVENT_TYPES::onNpcCmd) {
296
296
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);
300
301
if (std::holds_alternative<npc::CommandAction>(action)) {
301
302
auto & commands = std::get<npc::CommandAction>(action).commands ;
302
303
std::string command;
You can’t perform that action at this time.
0 commit comments