mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 06:53:52 +00:00
[Client] Prevent infinite guard arrest loops
This commit is contained in:
parent
f0f0b2dcc9
commit
b09e6644a9
1 changed files with 28 additions and 0 deletions
|
@ -8,6 +8,16 @@
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
#include "../mwworld/action.hpp"
|
#include "../mwworld/action.hpp"
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Include additional headers for multiplayer purposes
|
||||||
|
*/
|
||||||
|
#include "../mwgui/windowmanagerimp.hpp"
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
|
|
||||||
#include "movement.hpp"
|
#include "movement.hpp"
|
||||||
#include "creaturestats.hpp"
|
#include "creaturestats.hpp"
|
||||||
|
|
||||||
|
@ -46,11 +56,29 @@ bool AiPursue::execute (const MWWorld::Ptr& actor, CharacterController& characte
|
||||||
if(target.getClass().getCreatureStats(target).isDead())
|
if(target.getClass().getCreatureStats(target).isDead())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Because multiplayer does not pause the game, prevent infinite arrest loops by ignoring
|
||||||
|
players already engaged in dialogue
|
||||||
|
*/
|
||||||
|
if (target == MWBase::Environment::get().getWorld()->getPlayerPtr())
|
||||||
|
{
|
||||||
|
if (MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_Dialogue))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
|
|
||||||
actor.getClass().getCreatureStats(actor).setDrawState(DrawState_Nothing);
|
actor.getClass().getCreatureStats(actor).setDrawState(DrawState_Nothing);
|
||||||
|
|
||||||
//Set the target desition from the actor
|
//Set the target desition from the actor
|
||||||
ESM::Pathgrid::Point dest = target.getRefData().getPosition().pos;
|
ESM::Pathgrid::Point dest = target.getRefData().getPosition().pos;
|
||||||
|
|
||||||
|
|
||||||
if (pathTo(actor, dest, duration, 100)) {
|
if (pathTo(actor, dest, duration, 100)) {
|
||||||
target.getClass().activate(target,actor).get()->execute(actor); //Arrest player when reached
|
target.getClass().activate(target,actor).get()->execute(actor); //Arrest player when reached
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue