Getting an Actor from an MWClass?

Everything about development and the OpenMW source code.
Post Reply
h313
Posts: 9
Joined: 10 Jul 2017, 19:50

Getting an Actor from an MWClass?

Post by h313 »

As the title says, how would I get an object of class MWClass::Actor from a MWClass?
User avatar
MiroslavR
Posts: 156
Joined: 12 Feb 2014, 17:45

Re: Getting an Actor from an MWClass?

Post by MiroslavR »

That makes no sense. What are you trying to do exactly? Perhaps you're looking for MWWorld::Ptr::getClass()?
h313
Posts: 9
Joined: 10 Jul 2017, 19:50

Re: Getting an Actor from an MWClass?

Post by h313 »

So I have a MWWord::Ptr which points to an NPC, and I need to get the AiCombatStorage of the actor.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Getting an Actor from an MWClass?

Post by scrawl »

Ok, and why are you trying to do that?

Have you heard of the XY problem?
h313
Posts: 9
Joined: 10 Jul 2017, 19:50

Re: Getting an Actor from an MWClass?

Post by h313 »

I'm trying to fix bug 3935 which entails getting mStrength from an AiCombatStorage in character.cpp
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Getting an Actor from an MWClass?

Post by scrawl »

That sounds like a wrong way to do it. The AI should call the character controller, not the other way around.
h313
Posts: 9
Joined: 10 Jul 2017, 19:50

Re: Getting an Actor from an MWClass?

Post by h313 »

So how should I pass mStrength to CharacterController::updateWeaponState()?
Post Reply