forked from teamnwah/openmw-tes3coop
[Client] Use different way of preventing attacks on players in dialogue
This commit is contained in:
parent
ea7c3f2dc7
commit
ce9605957a
2 changed files with 19 additions and 27 deletions
|
@ -12,6 +12,7 @@
|
||||||
#include <components/openmw-mp/Log.hpp>
|
#include <components/openmw-mp/Log.hpp>
|
||||||
#include "../mwmp/Main.hpp"
|
#include "../mwmp/Main.hpp"
|
||||||
#include "../mwmp/MechanicsHelper.hpp"
|
#include "../mwmp/MechanicsHelper.hpp"
|
||||||
|
#include "../mwgui/windowmanagerimp.hpp"
|
||||||
/*
|
/*
|
||||||
End of tes3mp addition
|
End of tes3mp addition
|
||||||
*/
|
*/
|
||||||
|
@ -240,6 +241,24 @@ namespace MWMechanics
|
||||||
currentCell = actor.getCell();
|
currentCell = actor.getCell();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Because multiplayer doesn't pause the world during dialogue, disallow attacks on
|
||||||
|
a player engaged in dialogue
|
||||||
|
*/
|
||||||
|
if (target == MWBase::Environment::get().getWorld()->getPlayerPtr())
|
||||||
|
{
|
||||||
|
if (MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_Dialogue))
|
||||||
|
{
|
||||||
|
storage.stopAttack();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
|
|
||||||
bool forceFlee = false;
|
bool forceFlee = false;
|
||||||
if (!canFight(actor, target))
|
if (!canFight(actor, target))
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,16 +13,6 @@
|
||||||
#include "../mwworld/actionequip.hpp"
|
#include "../mwworld/actionequip.hpp"
|
||||||
#include "../mwworld/cellstore.hpp"
|
#include "../mwworld/cellstore.hpp"
|
||||||
|
|
||||||
/*
|
|
||||||
Start of tes3mp addition
|
|
||||||
|
|
||||||
Include additional headers for multiplayer purposes
|
|
||||||
*/
|
|
||||||
#include "../mwgui/windowmanagerimp.hpp"
|
|
||||||
/*
|
|
||||||
End of tes3mp addition
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "npcstats.hpp"
|
#include "npcstats.hpp"
|
||||||
#include "spellcasting.hpp"
|
#include "spellcasting.hpp"
|
||||||
#include "combat.hpp"
|
#include "combat.hpp"
|
||||||
|
@ -764,23 +754,6 @@ namespace MWMechanics
|
||||||
ESM::Position actorPos = actor.getRefData().getPosition();
|
ESM::Position actorPos = actor.getRefData().getPosition();
|
||||||
ESM::Position enemyPos = enemy.getRefData().getPosition();
|
ESM::Position enemyPos = enemy.getRefData().getPosition();
|
||||||
|
|
||||||
/*
|
|
||||||
Start of tes3mp addition
|
|
||||||
|
|
||||||
Because multiplayer doesn't pause the world during dialogue, disallow fights with
|
|
||||||
a player engaged in dialogue
|
|
||||||
*/
|
|
||||||
if (enemy == MWBase::Environment::get().getWorld()->getPlayerPtr())
|
|
||||||
{
|
|
||||||
if (MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_Dialogue))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
End of tes3mp addition
|
|
||||||
*/
|
|
||||||
|
|
||||||
const CreatureStats& enemyStats = enemy.getClass().getCreatureStats(enemy);
|
const CreatureStats& enemyStats = enemy.getClass().getCreatureStats(enemy);
|
||||||
if (enemyStats.getMagicEffects().get(ESM::MagicEffect::Invisibility).getMagnitude() > 0
|
if (enemyStats.getMagicEffects().get(ESM::MagicEffect::Invisibility).getMagnitude() > 0
|
||||||
|| enemyStats.getMagicEffects().get(ESM::MagicEffect::Chameleon).getMagnitude() > 0)
|
|| enemyStats.getMagicEffects().get(ESM::MagicEffect::Chameleon).getMagnitude() > 0)
|
||||||
|
|
Loading…
Reference in a new issue