Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bots

Development::Bots Forum for bots.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 02-14-2015, 12:51 AM
rencro
Hill Giant
 
Join Date: Sep 2008
Location: So. California
Posts: 219
Default

Well, been trying to isolate exactly why memory in g->membername is being corrupted, causing groupcount to assume you have a six person group, but its slow going, have stepped through the code many times now but cant pin it down.

For now, you could put a check in place to clean up the corrupted memory and allow the rest of the function to proceed as normal, but again, we need to find out why the memory is being written with garbage during this process.

bot.cpp
bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) {
about line 5909 if you have no custom code, such as the bot melee fix, ect.
Code:
// delete from group data
RemoveBotFromGroup(this, g);

// if group members exist below this one, move
// them all up one slot in the group list
int j = i+1;
for(; j<MAX_GROUP_MEMBERS; j++) {
    if(g->members[j]) {
Replace with
Code:
// delete from group data
RemoveBotFromGroup(this, g);

// if group members exist below this one, move
// them all up one slot in the group list
if(g->GroupCount() == 6) {
    for(int x=0; x<MAX_GROUP_MEMBERS; x++) {
        g->membername[x][0] = '\0';
        memset(g->membername[x], 0, 64);
        g->members[x] = nullptr;
    }
}
int j = i+1;
for(; j<MAX_GROUP_MEMBERS; j++) {
    if(g->members[j]) {
I tested with me(client) and 5 bots and killed each bot off one at a time with #damage 2000 and memory looks good as each bot is taken out of the group, but on the last bot, the memory at g->membername gets overwritten with garbage, leading to a crash in the strcpy phase. This little work around cleans up that memory.

I'll keep plugging away as time permits, but seems only you and me are seeing this issue which seems odd?
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:44 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3