Fix GetPcInJail to work as in the original engine

coverity_scan
scrawl 9 years ago
parent 190bf15887
commit 4f8f166f69

@ -545,6 +545,8 @@ namespace MWBase
virtual float getHitDistance(const MWWorld::ConstPtr& actor, const MWWorld::ConstPtr& target) = 0;
virtual void removeContainerScripts(const MWWorld::Ptr& reference) = 0;
virtual bool isPlayerInJail() const = 0;
};
}

@ -1014,7 +1014,7 @@ namespace MWScript
virtual void execute (Interpreter::Runtime &runtime)
{
runtime.push (MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_Jail));
runtime.push (MWBase::Environment::get().getWorld()->isPlayerInJail());
}
};

@ -2996,6 +2996,14 @@ namespace MWWorld
}
}
bool World::isPlayerInJail() const
{
if (mGoToJail)
return true;
return MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_Jail);
}
void World::spawnRandomCreature(const std::string &creatureList)
{
const ESM::CreatureLevList* list = getStore().get<ESM::CreatureLevList>().find(creatureList);

@ -645,6 +645,8 @@ namespace MWWorld
/// Return the distance between actor's weapon and target's collision box.
virtual float getHitDistance(const MWWorld::ConstPtr& actor, const MWWorld::ConstPtr& target);
virtual bool isPlayerInJail() const;
};
}

Loading…
Cancel
Save