[Client] Make it possible to get LocalActor from CellController

0.6.1
David Cernat 8 years ago
parent 10be52d40d
commit 18be1880f0

@ -147,6 +147,11 @@ void Cell::readCellFrame(WorldEvent& worldEvent)
}
}
LocalActor *Cell::getLocalActor(std::string actorIndex)
{
return localActors.at(actorIndex);
}
MWWorld::CellStore *Cell::getCellStore()
{
return store;

@ -20,6 +20,8 @@ namespace mwmp
void uninitializeLocalActors();
void readCellFrame(mwmp::WorldEvent& worldEvent);
virtual LocalActor *getLocalActor(std::string actorIndex);
MWWorld::CellStore* getCellStore();
std::string getDescription();

@ -8,6 +8,7 @@
#include "CellController.hpp"
#include "Main.hpp"
#include "LocalActor.hpp"
#include "LocalPlayer.hpp"
using namespace mwmp;
@ -99,6 +100,14 @@ bool CellController::hasLocalActorRecord(MWWorld::Ptr ptr)
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 mapIndex = "";

@ -24,6 +24,8 @@ namespace mwmp
void removeLocalActorRecord(std::string actorIndex);
bool hasLocalActorRecord(MWWorld::Ptr ptr);
virtual LocalActor *getLocalActor(MWWorld::Ptr ptr);
std::string generateMapIndex(MWWorld::Ptr ptr);
std::string generateMapIndex(mwmp::WorldObject object);

Loading…
Cancel
Save