mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Make StayOutside only block teleportation from exteriors to interiors
This commit is contained in:
parent
cd4d76f8c5
commit
dfc72e9b7e
@ -52,6 +52,7 @@
|
||||
Bug #6289: Keyword search in dialogues expected the text to be all ASCII characters
|
||||
Bug #6302: Teleporting disabled actor breaks its disabled state
|
||||
Bug #6307: Pathfinding in Infidelities quest from Tribunal addon is broken
|
||||
Bug #6323: Wyrmhaven: Alboin doesn't follower the player character out of his house
|
||||
Feature #890: OpenMW-CS: Column filtering
|
||||
Feature #2554: Modifying an object triggers the instances table to scroll to the corresponding record
|
||||
Feature #2780: A way to see current OpenMW version in the console
|
||||
|
@ -74,7 +74,7 @@ namespace MWGui
|
||||
|
||||
// Add price for the travelling followers
|
||||
std::set<MWWorld::Ptr> followers;
|
||||
MWWorld::ActionTeleport::getFollowers(player, followers);
|
||||
MWWorld::ActionTeleport::getFollowers(player, followers, !interior);
|
||||
|
||||
// Apply followers cost, unlike vanilla the first follower doesn't travel for free
|
||||
price *= 1 + static_cast<int>(followers.size());
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "../mwmechanics/creaturestats.hpp"
|
||||
|
||||
#include "../mwworld/cellstore.hpp"
|
||||
#include "../mwworld/class.hpp"
|
||||
|
||||
#include "player.hpp"
|
||||
@ -24,7 +25,7 @@ namespace MWWorld
|
||||
{
|
||||
// Find any NPCs that are following the actor and teleport them with him
|
||||
std::set<MWWorld::Ptr> followers;
|
||||
getFollowers(actor, followers, true);
|
||||
getFollowers(actor, followers, mCellName.empty(), true);
|
||||
|
||||
for (std::set<MWWorld::Ptr>::iterator it = followers.begin(); it != followers.end(); ++it)
|
||||
teleport(*it);
|
||||
@ -62,7 +63,7 @@ namespace MWWorld
|
||||
}
|
||||
}
|
||||
|
||||
void ActionTeleport::getFollowers(const MWWorld::Ptr& actor, std::set<MWWorld::Ptr>& out, bool includeHostiles) {
|
||||
void ActionTeleport::getFollowers(const MWWorld::Ptr& actor, std::set<MWWorld::Ptr>& out, bool toExterior, bool includeHostiles) {
|
||||
std::set<MWWorld::Ptr> followers;
|
||||
MWBase::Environment::get().getMechanicsManager()->getActorsFollowing(actor, followers);
|
||||
|
||||
@ -75,7 +76,7 @@ namespace MWWorld
|
||||
if (!includeHostiles && follower.getClass().getCreatureStats(follower).getAiSequence().isInCombat(actor))
|
||||
continue;
|
||||
|
||||
if (!script.empty() && follower.getRefData().getLocals().getIntVar(script, "stayoutside") == 1)
|
||||
if (!toExterior && !script.empty() && follower.getRefData().getLocals().getIntVar(script, "stayoutside") == 1 && follower.getCell()->getCell()->isExterior())
|
||||
continue;
|
||||
|
||||
if ((follower.getRefData().getPosition().asVec3() - actor.getRefData().getPosition().asVec3()).length2() > 800 * 800)
|
||||
|
@ -30,7 +30,7 @@ namespace MWWorld
|
||||
|
||||
/// @param includeHostiles If true, include hostile followers (which won't actually be teleported) in the output,
|
||||
/// e.g. so that the teleport action can calm them.
|
||||
static void getFollowers(const MWWorld::Ptr& actor, std::set<MWWorld::Ptr>& out, bool includeHostiles = false);
|
||||
static void getFollowers(const MWWorld::Ptr& actor, std::set<MWWorld::Ptr>& out, bool toExterior, bool includeHostiles = false);
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user