1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-05 15:55:45 +00:00

Make sure player doesn't get any AI packages (Bug #1749)

This commit is contained in:
scrawl 2014-08-03 22:29:50 +02:00
parent 8707f7b116
commit 1fc424ce30
2 changed files with 5 additions and 0 deletions

View File

@ -245,6 +245,9 @@ void AiSequence::clear()
void AiSequence::stack (const AiPackage& package, const MWWorld::Ptr& actor)
{
if (actor == MWBase::Environment::get().getWorld()->getPlayerPtr())
throw std::runtime_error("Can't add AI packages to player");
if (package.getTypeId() == AiPackage::TypeIdCombat || package.getTypeId() == AiPackage::TypeIdPursue)
{
// Notify AiWander of our current position so we can return to it after combat finished

View File

@ -244,6 +244,8 @@ namespace MWWorld
mPlayer.load (player.mObject);
getPlayer().getClass().getCreatureStats(getPlayer()).getAiSequence().clear();
MWBase::World& world = *MWBase::Environment::get().getWorld();
try