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

Development::Bots Forum for bots.

Reply
 
Thread Tools Display Modes
  #1  
Old 05-30-2015, 01:10 PM
rencro
Hill Giant
 
Join Date: Sep 2008
Location: So. California
Posts: 219
Default

Still crashes on last bot members death.

Ex: Me and my single bot in a 2 person group, bot dies, CRASH.

Group's memory has already been deleted in this case once coming back from:

Code:
// delete from group data
					RemoveBotFromGroup(this, g);
So when this gets processed:

Code:
					// 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]) {
							g->members[j-1] = g->members[j];
							strcpy(g->membername[j-1], g->members[j]->GetCleanName());
							g->membername[j][0] = '\0';
							memset(g->membername[j], 0, 64);
							g->members[j] = nullptr;
						}
					}
It crashes, as I mentioned, that memory is gone.

Looks like it just needed your change moved up in the code: as in

Code:
diff --git a/zone/bot.cpp b/zone/bot.cpp
index ebc5f47..f382272 100644
--- a/zone/bot.cpp
+++ b/zone/bot.cpp
@@ -5897,6 +5897,11 @@ bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, SkillUseTypes att
 					// delete from group data
 					RemoveBotFromGroup(this, g);
 
+					//Make sure group still exists if it doesnt they were already updated in RemoveBotFromGroup
+					g = GetGroup();
+					if (!g)
+						break;
+
 					// if group members exist below this one, move
 					// them all up one slot in the group list
 					int j = i+1;
@@ -5910,11 +5915,6 @@ bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, SkillUseTypes att
 						}
 					}
 					
-					//Make sure group still exists if it doesnt they were already updated in RemoveBotFromGroup
-					g = GetGroup();
-					if (!g)
-						break;
-					
 					// update the client group
 					EQApplicationPacket* outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct));
 					GroupJoin_Struct* gu = (GroupJoin_Struct*)outapp->pBuffer;
And then I dont crash in this situation.

Thanks..
Reply With Quote
  #2  
Old 05-30-2015, 05:59 PM
phantomghost
Hill Giant
 
Join Date: May 2015
Posts: 132
Default

When I am recompiling this it looks like the update files related to this were

bot.cpp
bot.h
questmgr.cpp

When I compile bot.cpp I get 10 errors related to setcurrentspeed.

Not sure what I missed or if I missed adding something, but I cannot get the compile to succeed.
Reply With Quote
  #3  
Old 05-30-2015, 06:16 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

Update your source again.
Reply With Quote
Reply

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 01:15 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