diff --git a/apps/openmw-mp/Script/Functions/Mechanics.cpp b/apps/openmw-mp/Script/Functions/Mechanics.cpp index 57790932a..4197300c0 100644 --- a/apps/openmw-mp/Script/Functions/Mechanics.cpp +++ b/apps/openmw-mp/Script/Functions/Mechanics.cpp @@ -159,13 +159,20 @@ void MechanicsFunctions::SetWerewolfState(unsigned short pid, bool isWerewolf) n player->isWerewolf = isWerewolf; } -void MechanicsFunctions::SetCreatureRefId(unsigned short pid, const char *refId, bool displayCreatureName) noexcept +void MechanicsFunctions::SetCreatureRefId(unsigned short pid, const char *refId) noexcept { Player *player; GET_PLAYER(pid, player, ); player->creatureRefId = refId; - player->displayCreatureName = displayCreatureName; +} + +void MechanicsFunctions::SetCreatureNameDisplayState(unsigned short pid, bool displayState) noexcept +{ + Player *player; + GET_PLAYER(pid, player, ); + + player->displayCreatureName = displayState; } void MechanicsFunctions::SendMarkLocation(unsigned short pid) diff --git a/apps/openmw-mp/Script/Functions/Mechanics.hpp b/apps/openmw-mp/Script/Functions/Mechanics.hpp index 31e379401..cd067a0b7 100644 --- a/apps/openmw-mp/Script/Functions/Mechanics.hpp +++ b/apps/openmw-mp/Script/Functions/Mechanics.hpp @@ -27,6 +27,7 @@ {"SetScale", MechanicsFunctions::SetScale},\ {"SetWerewolfState", MechanicsFunctions::SetWerewolfState},\ {"SetCreatureRefId", MechanicsFunctions::SetCreatureRefId},\ + {"SetCreatureNameDisplayState", MechanicsFunctions::SetCreatureNameDisplayState},\ \ {"SendMarkLocation", MechanicsFunctions::SendMarkLocation},\ {"SendSelectedSpell", MechanicsFunctions::SendSelectedSpell},\ @@ -230,7 +231,17 @@ public: * when hovered over by others. * \return void */ - static void SetCreatureRefId(unsigned short pid, const char *refId, bool displayCreatureName) noexcept; + static void SetCreatureRefId(unsigned short pid, const char *refId) noexcept; + + /** + * \brief Set whether a player's name is replaced by that of the creature they are + * disguised as when other players hover over them. + * + * \param pid The player ID. + * \param displayState The creature name display state. + * \return void + */ + static void SetCreatureNameDisplayState(unsigned short pid, bool displayState) noexcept; /** * \brief Send a PlayerMiscellaneous packet with a Mark location to a player.