From 9ab58b67088c120982b9906f9efff265c30fd6c8 Mon Sep 17 00:00:00 2001 From: Koncord Date: Tue, 27 Jun 2017 14:49:39 +0800 Subject: [PATCH] [Server] Remove redundant SetResurrectType Rename SendResurrect to Resurrect --- apps/openmw-mp/Script/Functions/Death.cpp | 11 ++--------- apps/openmw-mp/Script/Functions/Death.hpp | 8 ++------ 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/apps/openmw-mp/Script/Functions/Death.cpp b/apps/openmw-mp/Script/Functions/Death.cpp index ce283bfcf..83467df81 100644 --- a/apps/openmw-mp/Script/Functions/Death.cpp +++ b/apps/openmw-mp/Script/Functions/Death.cpp @@ -7,19 +7,12 @@ #include using namespace std; -void DeathFunctions::SetResurrectType(unsigned short pid, unsigned int type) -{ - Player *player; - GET_PLAYER(pid, player,); - - player->resurrectType = type; -} - -void DeathFunctions::SendResurrect(unsigned short pid) noexcept +void DeathFunctions::Resurrect(unsigned short pid, unsigned int type) noexcept { Player *player; GET_PLAYER(pid, player, ); + player->resurrectType = type; mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_RESURRECT)->setPlayer(player); mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_RESURRECT)->Send(false); mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_RESURRECT)->Send(true); diff --git a/apps/openmw-mp/Script/Functions/Death.hpp b/apps/openmw-mp/Script/Functions/Death.hpp index a16b2d55e..c8fac0ecc 100644 --- a/apps/openmw-mp/Script/Functions/Death.hpp +++ b/apps/openmw-mp/Script/Functions/Death.hpp @@ -4,16 +4,12 @@ #include "../Types.hpp" #define DEATHAPI \ - {"SetResurrectType", DeathFunctions::SetResurrectType},\ - \ - {"SendResurrect", DeathFunctions::SendResurrect} + {"Resurrect", DeathFunctions::Resurrect} class DeathFunctions { public: - static void SetResurrectType(unsigned short pid, unsigned int type); - - static void SendResurrect(unsigned short pid) noexcept; + static void Resurrect(unsigned short pid) noexcept; }; #endif //OPENMW_DEATHAPI_HPP