diff --git a/apps/openmw-mp/Script/Functions/Actors.cpp b/apps/openmw-mp/Script/Functions/Actors.cpp new file mode 100644 index 000000000..3466a7872 --- /dev/null +++ b/apps/openmw-mp/Script/Functions/Actors.cpp @@ -0,0 +1,28 @@ +#include + +#include +#include +#include +#include +#include +#include "Actors.hpp" + +using namespace mwmp; + +ActorList actorList; +BaseActor tempActor; + +void ActorFunctions::InitActorList(unsigned short pid) noexcept +{ + Player *player; + GET_PLAYER(pid, player, ); + + actorList.cell.blank(); + actorList.baseActors.clear(); + actorList.guid = player->guid; +} + +unsigned int ActorFunctions::GetActorListSize() noexcept +{ + return mwmp::Networking::getPtr()->getLastEvent()->objectChanges.count; +} diff --git a/apps/openmw-mp/Script/Functions/Actors.hpp b/apps/openmw-mp/Script/Functions/Actors.hpp new file mode 100644 index 000000000..9f607b966 --- /dev/null +++ b/apps/openmw-mp/Script/Functions/Actors.hpp @@ -0,0 +1,19 @@ +#ifndef OPENMW_ACTORFUNCTIONS_HPP +#define OPENMW_ACTORFUNCTIONS_HPP + +#define ACTORAPI \ + {"InitActorList", ActorFunctions::InitActorList},\ + \ + {"GetActorListSize", ActorFunctions::GetActorListSize} + +class ActorFunctions +{ +public: + + static void InitActorList(unsigned short pid) noexcept; + + static unsigned int GetActorListSize() noexcept; +}; + + +#endif //OPENMW_ACTORFUNCTIONS_HPP diff --git a/apps/openmw-mp/Script/ScriptFunctions.hpp b/apps/openmw-mp/Script/ScriptFunctions.hpp index 24e17471d..b0e61a91b 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.hpp +++ b/apps/openmw-mp/Script/ScriptFunctions.hpp @@ -13,6 +13,7 @@ #include