[Client] Remove isLocalActor (no longer needed) from LiveCellRefBase

pull/199/head
David Cernat 8 years ago
parent ca8fd1aa72
commit 8ebe7ed683

@ -11,9 +11,18 @@
#include <components/settings/settings.hpp>
/*
Start of tes3mp addition
Include additional headers for multiplayer purposes
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/CellController.hpp"
#include "../mwmp/DedicatedPlayer.hpp"
#include "../mwmp/LocalPlayer.hpp"
/*
End of tes3mp addition
*/
#include "../mwworld/esmstore.hpp"
#include "../mwworld/class.hpp"
@ -1139,14 +1148,17 @@ namespace MWMechanics
return; // for now abort update of the old cell when cell changes by teleportation magic effect
// a better solution might be to apply cell changes at the end of the frame
}
/*
Start of tes3mp change (major)
Allow AI processing when LiveCellRefBase's isLocalActor set to true
*/
bool isLocalActor = mwmp::Main::get().getCellController()->isLocalActor(actor);
//if (MWBase::Environment::get().getMechanicsManager()->isAIActive() && inProcessingRange)
if ((MWBase::Environment::get().getMechanicsManager()->isAIActive() || actor.getBase()->isLocalActor)
if ((MWBase::Environment::get().getMechanicsManager()->isAIActive() || isLocalActor)
&& inProcessingRange)
/*
End of tes3mp change (major)

@ -40,7 +40,8 @@ void Cell::updateLocal(bool forceUpdate)
if (actor->getPtr().getCell() != store)
{
LOG_APPEND(Log::LOG_INFO, "- Removing LocalActor %s which is no longer in this cell", it->first.c_str());
actor->getPtr().getBase()->isLocalActor = false;
Main::get().getCellController()->removeLocalActorRecord(it->first);
localActors.erase(it++);
}
else
@ -144,7 +145,6 @@ void Cell::initializeLocalActors()
LocalActor *actor = new LocalActor();
actor->cell = esmCell;
ptr.getBase()->isLocalActor = true;
actor->setPtr(ptr);
std::string mapIndex = Main::get().getCellController()->generateMapIndex(ptr);
@ -189,7 +189,6 @@ void Cell::uninitializeLocalActors()
for (std::map<std::string, LocalActor *>::iterator it = localActors.begin(); it != localActors.end(); ++it)
{
LocalActor *actor = it->second;
actor->getPtr().getBase()->isLocalActor = false;
Main::get().getCellController()->removeLocalActorRecord(it->first);
}

@ -20,7 +20,6 @@ MWWorld::LiveCellRefBase::LiveCellRefBase(const std::string& type, const ESM::Ce
Set default values for tes3mp-only booleans
*/
canChangeCell = true;
isLocalActor = false;
/*
End of tes3mp addition
*/

@ -38,17 +38,6 @@ namespace MWWorld
End of tes3mp addition
*/
/*
Start of tes3mp addition
Useful boolean for quickly establishing which creatures and NPCs should be
processed locally by the player
*/
bool isLocalActor;
/*
End of tes3mp addition
*/
/** runtime-data */
RefData mData;

Loading…
Cancel
Save