当前位置:首页>>魔兽单机>>正文
防止无限刷副本BUG新的代码-WOW模拟器C++代码
2013-07-05 17:49:49 作者:网络 来源: 浏览次数:0
摘要:防止无限刷副本BUG新的代码-WOW模拟器C++代码
 Index: MiscHandler.cpp
===================================================================
--- MiscHandler.cpp (revision 573)
+++ MiscHandler.cpp (working copy)
@@ -1484,14 +1484,36 @@
     if(_player->getLevel() < LEVELREQUIREMENT_HEROIC)
         return;
 
-    if(Group *pGroup = _player->GetGroup())
+    Group *pGroup = _player->GetGroup(); //防止无限刷副本BUG Fiver
+    if(pGroup)
     {
         if(pGroup->IsLeader(_player->GetGUID()))
         {
-            // the difficulty is set even if the instances can't be reset
-            //_player->SendDungeonDifficulty(true);
-            pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, false, _player);
-            pGroup->SetDungeonDifficulty(Difficulty(mode));
+            for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+            { //防止无限刷副本BUG Fiver
+                Player* pGroupGuy = itr->getSource();
+                if(!pGroupGuy)
+                    continue;
+
+                if(!pGroupGuy->IsInMap(pGroupGuy))
+                    break;
+
+                map = pGroupGuy->GetMap();
+                if(map && map->IsRaidOrHeroicDungeon() )
+                {
+                    sLog.outError("MgCore Prevent Hack Instance 1:: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
+                    //KickPlayer();
+ break;
+                }
+ else if (!map->IsRaidOrHeroicDungeon())
+ {
+                    // the difficulty is set even if the instances can't be reset
+                    //_player->SendDungeonDifficulty(true);
+                    pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, false, _player);
+                    pGroup->SetDungeonDifficulty(Difficulty(mode));
+ break;
+ }
+ }//防止无限刷副本BUG Fiver  
         }
     }
     else
@@ -1528,14 +1550,36 @@
     if(_player->getLevel() < LEVELREQUIREMENT_HEROIC)
         return;
 
-    if(Group *pGroup = _player->GetGroup())
+    Group *pGroup = _player->GetGroup();
+    if(pGroup) //防止无限刷副本BUG Fiver
     {
         if(pGroup->IsLeader(_player->GetGUID()))
         {
-            // the difficulty is set even if the instances can't be reset
-            //_player->SendDungeonDifficulty(true);
-            pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, true, _player);
-            pGroup->SetRaidDifficulty(Difficulty(mode));
+            for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+            { //防止无限刷副本BUG Fiver
+                Player* pGroupGuy = itr->getSource();
+                if(!pGroupGuy)
+                    continue;
+
+                if(!pGroupGuy->IsInMap(pGroupGuy))
+                    break;
+
+                map = pGroupGuy->GetMap();
+                if( map && map->IsRaidOrHeroicDungeon() )
+                {
+                    sLog.outError("MgCore Prevent Hack Instance 2:: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
+                    //KickPlayer();
+ break;
+                }
+ else if (!map->IsRaidOrHeroicDungeon())
+ {
+                    // the difficulty is set even if the instances can't be reset
+                    //_player->SendDungeonDifficulty(true);
+                    pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, true, _player);
+                    pGroup->SetRaidDifficulty(Difficulty(mode));
+ break;
+ }
+ }//防止无限刷副本BUG Fiver  
         }
     }
     else
 


相关报道:

[关闭] [返回顶部]


  返回首页 | 最新资讯 | 资源下载 | 魔兽图片 | 单机文档 | 技术攻略 | 玩家视频
备案号:蜀ICP备2024062380号-1
免责声明:本网站为热爱怀旧WOW的玩家们建立的魔兽世界资料网站,仅供交流和学习使用,非盈利和商用.如有侵权之处,请联系我们,我们会在24小时内确认删除侵权内容,谢谢合作。
Copyright © 2024 - 2024 WOWAII.COM Corporation, All Rights Reserved

机器人国度