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?