diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 90ba16c88..340f15084 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -212,7 +212,6 @@ void Networking::Update(RakNet::Packet *packet) //packetMainStats.Read(player); player->CreatureStats()->mDead = true; myPacket->Send(player, true); - controller->GetPacket(ID_GAME_RESURRECT)->RequestData(player->guid); Script::Call(player->GetID()); diff --git a/apps/openmw-mp/Script/Functions/Stats.cpp b/apps/openmw-mp/Script/Functions/Stats.cpp index 5011ea05d..b6ba7ea3e 100644 --- a/apps/openmw-mp/Script/Functions/Stats.cpp +++ b/apps/openmw-mp/Script/Functions/Stats.cpp @@ -406,3 +406,10 @@ void ScriptFunctions::SetCharGenStage(unsigned short pid, int start, int end) no mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_CHARGEN)->Send(player, false); } + +void ScriptFunctions::Resurrect(unsigned short pid) +{ + Player *player; + GET_PLAYER(pid, player,); + mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_RESURRECT)->RequestData(player->guid); +} \ No newline at end of file diff --git a/apps/openmw-mp/Script/ScriptFunctions.hpp b/apps/openmw-mp/Script/ScriptFunctions.hpp index 618437e0a..550d3bba3 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.hpp +++ b/apps/openmw-mp/Script/ScriptFunctions.hpp @@ -90,6 +90,7 @@ public: static int GetIncreaseSkill(unsigned short pid, unsigned int pos) noexcept; static void SetIncreaseSkill(unsigned short pid, unsigned int pos, int value) noexcept; + static void Resurrect(unsigned short pid); //static void AddItem(unsigned short pid, const char* itemName, unsigned short count) noexcept; //static void RemoveItem(unsigned short pid, const char* itemName, unsigned short count) noexcept; @@ -205,6 +206,7 @@ public: {"HasItemEquipped", ScriptFunctions::HasItemEquipped}, {"SendMessage", ScriptFunctions::SendMessage}, {"SetCharGenStage", ScriptFunctions::SetCharGenStage}, + {"Resurrect", ScriptFunctions::Resurrect}, {"Kick", ScriptFunctions::Kick}, }; @@ -224,4 +226,4 @@ public: }; }; -#endif //SOURCEPAWN_SCRIPTFUNCTIONS_HPP +#endif //SOURCEPAWN_SCRIPTFUNCTIONS_HPP \ No newline at end of file