From 6607ae6d94ffeca37cc6f82495337a95472a6e7c Mon Sep 17 00:00:00 2001 From: ketoo <342006@qq.com> Date: Fri, 14 Apr 2017 00:58:00 -0700 Subject: [PATCH] the player should get the player list which in the same group --- NFComm/NFKernelPlugin/NFCKernelModule.cpp | 32 ++++++++++++++--------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/NFComm/NFKernelPlugin/NFCKernelModule.cpp b/NFComm/NFKernelPlugin/NFCKernelModule.cpp index c579d3d74a..1bf5fabdd4 100644 --- a/NFComm/NFKernelPlugin/NFCKernelModule.cpp +++ b/NFComm/NFKernelPlugin/NFCKernelModule.cpp @@ -1057,21 +1057,25 @@ bool NFCKernelModule::GetGroupObjectList(const int nSceneID, const int nGroupID, { NFGUID ident = NFGUID(); NF_SHARE_PTR pRet = pGroupInfo->mxPlayerList.First(ident); - while (!ident.IsNull() && noSelf != ident) + for (; pRet; pRet = pGroupInfo->mxPlayerList.Next(ident)) { - list.Add(ident); + if (!ident.IsNull() && ident != noSelf) + { + list.Add(ident); + } ident = NFGUID(); - pRet = pGroupInfo->mxPlayerList.Next(ident); } pRet = pGroupInfo->mxOtherList.First(ident); - while (!ident.IsNull() && noSelf != ident) + for (; pRet; pRet = pGroupInfo->mxOtherList.Next(ident)) { - list.Add(ident); + if (!ident.IsNull() && ident != noSelf) + { + list.Add(ident); + } ident = NFGUID(); - pRet = pGroupInfo->mxOtherList.Next(ident); } return true; @@ -1169,24 +1173,28 @@ bool NFCKernelModule::GetGroupObjectList(const int nSceneID, const int nGroupID, { NFGUID ident = NFGUID(); NF_SHARE_PTR pRet = pGroupInfo->mxPlayerList.First(ident); - while (!ident.IsNull() && ident != noSelf) + for (; pRet; pRet = pGroupInfo->mxPlayerList.Next(ident)) { - list.Add(ident); + if (!ident.IsNull() && ident != noSelf) + { + list.Add(ident); + } ident = NFGUID(); - pRet = pGroupInfo->mxPlayerList.Next(ident); } } else { NFGUID ident = NFGUID(); NF_SHARE_PTR pRet = pGroupInfo->mxOtherList.First(ident); - while (!ident.IsNull() && ident != noSelf) + for (; pRet; pRet = pGroupInfo->mxOtherList.Next(ident)) { - list.Add(ident); + if (!ident.IsNull() && ident != noSelf) + { + list.Add(ident); + } ident = NFGUID(); - pRet = pGroupInfo->mxOtherList.Next(ident); } }