forked from mirror/openmw-tes3mp
[General] Implement ActorAI packet, part 2
The server can now make actors start combat with players or other actors.
This commit is contained in:
parent
5628f3b977
commit
5baef09f79
2 changed files with 8 additions and 3 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "../mwdialogue/dialoguemanagerimp.hpp"
|
||||
|
||||
#include "../mwmechanics/aicombat.hpp"
|
||||
#include "../mwmechanics/aifollow.hpp"
|
||||
#include "../mwmechanics/creaturestats.hpp"
|
||||
#include "../mwmechanics/mechanicsmanagerimp.hpp"
|
||||
|
@ -240,14 +241,17 @@ void DedicatedActor::setAI()
|
|||
|
||||
if (targetPtr)
|
||||
{
|
||||
|
||||
|
||||
if (aiAction == mwmp::BaseActorList::FOLLOW)
|
||||
{
|
||||
MWMechanics::AiFollow package(targetPtr);
|
||||
package.allowAnyDistance(true);
|
||||
ptr.getClass().getCreatureStats(ptr).getAiSequence().stack(package, ptr, true);
|
||||
}
|
||||
else if (aiAction == mwmp::BaseActorList::COMBAT)
|
||||
{
|
||||
MWMechanics::AiCombat package(targetPtr);
|
||||
ptr.getClass().getCreatureStats(ptr).getAiSequence().stack(package, ptr, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,8 @@ namespace mwmp
|
|||
|
||||
enum AI_ACTION
|
||||
{
|
||||
FOLLOW = 0
|
||||
FOLLOW = 0,
|
||||
COMBAT = 1
|
||||
};
|
||||
|
||||
RakNet::RakNetGUID guid;
|
||||
|
|
Loading…
Reference in a new issue