Jump to content

[guide] merge arena on top of alterac


Guest balrok

Recommended Posts

this guide is as always just the way i do it, which surely can be improved somehow, feel free to criticize me and posting better solutions

merging arena with alterac: (co is an alias for checkout )

sidenode:

if you don't have co as alias, it can be defined through ~/.gitconfig

[alias]

co = checkout

git co master

git co -b alterac

git remote add balrok balroks_git-pull_url

git pull balrok alterac

git co master

git co -b arena

git pull balrok arena

git co alterac

git co -b av-arena

git merge arena

*some conflicts occur*

git mergetool

*successfully merged*

(you also can edit at this point some parts by hand, it doesn't matter)

git commit -a

-you are done-

git mergetool:

i use vimdiff, but wyk3d said that kdiff3 is a great tool.. and i think most other users will be happy with this too, cause it has a gui so you are able to use your mouse..

but i explain my vimdiff-view cause i don't know how it'll looks like in kdiff

at vimdiff it opens a vimeditor, with a splitscreen with 3 files in it:

filename.cpp.LOCAL the file like it was before the merge

filename.cpp - the file it looked like after the merge (also with some >>> === <<< signs in it to show you the conflicts you could easily resolv)

filename.cpp.REMOTE - the file from the branch you try to merge in

now i explain every thing you need to change, so that av works together with arena

battleground.cpp

   455 <<<<<<< HEAD:src/game/BattleGround.cpp
  456         winmsg = GetMangosString(LANG_BG_A_WINS); //TODO herald yells this.. (at least in bg_av)
  457 =======
  458         if(isBattleGround())
  459             winmsg = GetMangosString(LANG_BG_A_WINS);
  460         else
  461             winmsg = GetMangosString(LANG_ARENA_GOLD_WINS);
  462 >>>>>>> arena:src/game/BattleGround.cpp

<<<<
this code is from the alterac-branch (or the branch where you are currently in)
====
this code is from the other branch you try to merge in (arena)
>>>>>

cause the difference is just a comment, you can remove the alterac part so that after the change it looks like:

  458         if(isBattleGround())
  459             winmsg = GetMangosString(LANG_BG_A_WINS);
  460         else
  461             winmsg = GetMangosString(LANG_ARENA_GOLD_WINS);

the next thing in this file happens sometimes and is confusing:

  1521 <<<<<<< HEAD:src/game/BattleGround.cpp
 1522 int32 BattleGround::GetObjectType(uint64 guid)
 1523 {
 1524     for(uint32 i = 0;i <= m_BgObjects.size(); i++)
 1525         if(m_BgObjects[i] == guid)
 1526             return i;
 1527     sLog.outError("BattleGround: cheating? a player used a gameobject which isnt supposed to be a usable object!");
 1528     return -1;
 1529 }
 1530 
 1531 void BattleGround::HandleKillUnit(Creature *creature, Player *killer)
 1532 {
 1533 =======
 1534 // return the player's team based on battlegroundplayer info
 1535 // used in same faction arena matches mainly
 1536 uint32 BattleGround::GetPlayerTeam(uint64 guid)
 1537 {
 1538     std::map<uint64, BattleGroundPlayer>::const_iterator itr = m_Players.find(guid);
 1539     if(itr!=m_Players.end())
 1540         return itr->second.Team;
 1541     return 0;
 1542 }
 1543 
 1544 uint32 BattleGround::GetAlivePlayersCountByTeam(uint32 Team) const
 1545 {
 1546     int count = 0;
 1547     for(std::map<uint64, BattleGroundPlayer>::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
 1548     {
 1549         if(itr->second.Team == Team)
 1550         {
 1551             Player * pl = objmgr.GetPlayer(itr->first);
 1552             if(pl && pl->isAlive())
 1553                 ++count;
 1554         }
 1555     }
 1556     return count;
 1557 >>>>>>> arena:src/game/BattleGround.cpp
 1558 }

at the first time i haven't seen any relation, why this couldn't be merged be the script but after the compilation failed i found it out, look at these parts

 1531 void BattleGround::HandleKillUnit(Creature *creature, Player *killer)
 1532 {
 1533 =======

  1556     return count;
 1557 >>>>>>> arena:src/game/BattleGround.cpp
 1558 }

alterac had a function-segment ending with "}" and an arena-function, which also ended with "}" stole it

so you have to edit this code, that you just replace the "====" line with a "}"

in an earlier merge i've also seen that the "return true" was stolen.. so watch out for thieves..

also don't forget to remove the ">>>>", "===" and "<<<<" lines they are just for you to find out what things are conflicting

next file: language.h

quite easy, just remove the >>,==,<< lines and you are finished

unit.cpp

this conflict was with copying one part at another section, cause it's hard to explain and doesn't have much to do with stupid conflict-resolving (also it's not userfriendly) i changed the alterac patch in a way, that this conflict doesn't happen anymore..

thank you for reading, i hope something gets clear for you now.. and the best thing to learn merging is just practice.. this guide looks long but you are done with it in less then 5minutes

Link to comment
Share on other sites

  • 3 weeks later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use