1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 23:23:52 +00:00

[Server] Add GetActorCell() script function

This commit is contained in:
David Cernat 2017-04-27 14:59:49 +03:00
parent e53916da10
commit 1ce60fbf30
2 changed files with 7 additions and 0 deletions

View file

@ -34,6 +34,11 @@ unsigned char ActorFunctions::GetLastActorListAction() noexcept
return mwmp::Networking::getPtr()->getLastActorList()->action; return mwmp::Networking::getPtr()->getLastActorList()->action;
} }
const char *ActorFunctions::GetActorCell(unsigned int i) noexcept
{
return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).cell.getDescription().c_str();
}
const char *ActorFunctions::GetActorRefId(unsigned int i) noexcept const char *ActorFunctions::GetActorRefId(unsigned int i) noexcept
{ {
return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).refId.c_str(); return mwmp::Networking::getPtr()->getLastActorList()->baseActors.at(i).refId.c_str();

View file

@ -7,6 +7,7 @@
{"GetActorListSize", ActorFunctions::GetActorListSize},\ {"GetActorListSize", ActorFunctions::GetActorListSize},\
{"GetLastActorListAction", ActorFunctions::GetLastActorListAction},\ {"GetLastActorListAction", ActorFunctions::GetLastActorListAction},\
\ \
{"GetActorCell", ActorFunctions::GetActorCell},\
{"GetActorRefId", ActorFunctions::GetActorRefId},\ {"GetActorRefId", ActorFunctions::GetActorRefId},\
{"GetActorRefNumIndex", ActorFunctions::GetActorRefNumIndex},\ {"GetActorRefNumIndex", ActorFunctions::GetActorRefNumIndex},\
{"GetActorMpNum", ActorFunctions::GetActorMpNum},\ {"GetActorMpNum", ActorFunctions::GetActorMpNum},\
@ -32,6 +33,7 @@ public:
static unsigned int GetActorListSize() noexcept; static unsigned int GetActorListSize() noexcept;
static unsigned char GetLastActorListAction() noexcept; static unsigned char GetLastActorListAction() noexcept;
static const char *GetActorCell(unsigned int i) noexcept;
static const char *GetActorRefId(unsigned int i) noexcept; static const char *GetActorRefId(unsigned int i) noexcept;
static int GetActorRefNumIndex(unsigned int i) noexcept; static int GetActorRefNumIndex(unsigned int i) noexcept;
static int GetActorMpNum(unsigned int i) noexcept; static int GetActorMpNum(unsigned int i) noexcept;