From f02492a593cd711173e10ff7055ff34bce48580c Mon Sep 17 00:00:00 2001 From: David Cernat Date: Thu, 5 Jul 2018 19:40:28 +0300 Subject: [PATCH] [General] Temporarily include target names in mwmp::Target These will be removed once the server can get the names matching refIds by reading content files. --- apps/openmw/mwmp/MechanicsHelper.cpp | 3 +++ components/openmw-mp/Base/BaseStructs.hpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/apps/openmw/mwmp/MechanicsHelper.cpp b/apps/openmw/mwmp/MechanicsHelper.cpp index 9693ff481..b1c9fd856 100644 --- a/apps/openmw/mwmp/MechanicsHelper.cpp +++ b/apps/openmw/mwmp/MechanicsHelper.cpp @@ -116,6 +116,7 @@ mwmp::Target MechanicsHelper::getTarget(const MWWorld::Ptr& ptr) target.refId = ptrRef->getRefId(); target.refNumIndex = ptrRef->getRefNum().mIndex; target.mpNum = ptrRef->getMpNum(); + target.name = ptr.getClass().getName(ptr); } return target; @@ -127,6 +128,8 @@ void MechanicsHelper::clearTarget(mwmp::Target& target) target.refId.clear(); target.refNumIndex = -1; target.mpNum = -1; + + target.name.clear(); } bool MechanicsHelper::isEmptyTarget(const mwmp::Target& target) diff --git a/components/openmw-mp/Base/BaseStructs.hpp b/components/openmw-mp/Base/BaseStructs.hpp index 4f71d3b89..e64e50733 100644 --- a/components/openmw-mp/Base/BaseStructs.hpp +++ b/components/openmw-mp/Base/BaseStructs.hpp @@ -30,6 +30,8 @@ namespace mwmp int refNumIndex; int mpNum; + std::string name; // Remove this once the server can get names corresponding to different refIds + RakNet::RakNetGUID guid; };