forked from mirror/openmw-tes3mp
[Client] Make it possible to get LocalActor from CellController
This commit is contained in:
parent
10be52d40d
commit
18be1880f0
4 changed files with 18 additions and 0 deletions
|
@ -147,6 +147,11 @@ void Cell::readCellFrame(WorldEvent& worldEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LocalActor *Cell::getLocalActor(std::string actorIndex)
|
||||||
|
{
|
||||||
|
return localActors.at(actorIndex);
|
||||||
|
}
|
||||||
|
|
||||||
MWWorld::CellStore *Cell::getCellStore()
|
MWWorld::CellStore *Cell::getCellStore()
|
||||||
{
|
{
|
||||||
return store;
|
return store;
|
||||||
|
|
|
@ -20,6 +20,8 @@ namespace mwmp
|
||||||
void uninitializeLocalActors();
|
void uninitializeLocalActors();
|
||||||
void readCellFrame(mwmp::WorldEvent& worldEvent);
|
void readCellFrame(mwmp::WorldEvent& worldEvent);
|
||||||
|
|
||||||
|
virtual LocalActor *getLocalActor(std::string actorIndex);
|
||||||
|
|
||||||
MWWorld::CellStore* getCellStore();
|
MWWorld::CellStore* getCellStore();
|
||||||
std::string getDescription();
|
std::string getDescription();
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include "CellController.hpp"
|
#include "CellController.hpp"
|
||||||
#include "Main.hpp"
|
#include "Main.hpp"
|
||||||
|
#include "LocalActor.hpp"
|
||||||
#include "LocalPlayer.hpp"
|
#include "LocalPlayer.hpp"
|
||||||
using namespace mwmp;
|
using namespace mwmp;
|
||||||
|
|
||||||
|
@ -99,6 +100,14 @@ bool CellController::hasLocalActorRecord(MWWorld::Ptr ptr)
|
||||||
return (localActorsToCells.count(mapIndex) > 0);
|
return (localActorsToCells.count(mapIndex) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LocalActor *CellController::getLocalActor(MWWorld::Ptr ptr)
|
||||||
|
{
|
||||||
|
std::string actorIndex = generateMapIndex(ptr);
|
||||||
|
std::string cellIndex = localActorsToCells.at(actorIndex);
|
||||||
|
|
||||||
|
cellsActive.at(cellIndex)->getLocalActor(actorIndex);
|
||||||
|
}
|
||||||
|
|
||||||
std::string CellController::generateMapIndex(MWWorld::Ptr ptr)
|
std::string CellController::generateMapIndex(MWWorld::Ptr ptr)
|
||||||
{
|
{
|
||||||
std::string mapIndex = "";
|
std::string mapIndex = "";
|
||||||
|
|
|
@ -24,6 +24,8 @@ namespace mwmp
|
||||||
void removeLocalActorRecord(std::string actorIndex);
|
void removeLocalActorRecord(std::string actorIndex);
|
||||||
bool hasLocalActorRecord(MWWorld::Ptr ptr);
|
bool hasLocalActorRecord(MWWorld::Ptr ptr);
|
||||||
|
|
||||||
|
virtual LocalActor *getLocalActor(MWWorld::Ptr ptr);
|
||||||
|
|
||||||
std::string generateMapIndex(MWWorld::Ptr ptr);
|
std::string generateMapIndex(MWWorld::Ptr ptr);
|
||||||
std::string generateMapIndex(mwmp::WorldObject object);
|
std::string generateMapIndex(mwmp::WorldObject object);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue