celguar / spp-classics-cmangos

SPP Classics repack with ike3 playerbots. Based on cmangos. Supports 1.12, 2.4.3, 3.3.5. Check "Releases" for installer
219 stars 59 forks source link

Possible auto join bg fix #174

Open Karrz1 opened 1 year ago

Karrz1 commented 1 year ago

think this is more a band-aid fix than a proper fix but works, can have bots running auto-bg for those who want it.

Creature::Create+EE C:\mangos\mangos-tbc\src\game\Entities\Creature.cpp line 928

// Notify the PvP script BattleGroundMap battlegroundMap = dynamic_cast<BattleGroundMap>(GetMap()); if (battlegroundMap != nullptr) { BattleGround* battleground = battlegroundMap->GetBG(); if (battleground != nullptr) { battleground->HandleCreatureCreate(this); } }

GameObject::Create+48C C:\mangos\mangos-tbc\src\game\Entities\GameObject.cpp line 291

// Notify the battleground or outdoor pvp script if (map->IsBattleGroundOrArena()) { BattleGround battleground = ((BattleGroundMap)map)->GetBG(); if (battleground) battleground->HandleGameObjectCreate(this); } else if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(GetZoneId())) outdoorPvP->HandleGameObjectCreate(this);

1 2

this was on TBC, had the server running 16 hours with 5k bots running auto bgs before turning off. On the server have a few bgs running and don't have crashes due to BGs anymore. Do have a lot of changes to the src file but I remember these been the 2 that needed sorted, maybe want to test and see if it works as I dont have a fresh copy only the live version.

this was with help from Flekz and changed a little bot code also that allowed this to work and still seems to be working, I am not running latest bots, havent updated them in maybe 2 weeks