[FIXED]Crash EQ2Emu :p
- alfa
- Team Member
- Posts: 550
- Joined: Fri Jul 27, 2007 6:24 pm
- Location: France
- Contact:
[FIXED]Crash EQ2Emu :p
Using SF client, testing some bow trick, I have try to unequip bow and range attack. No action, no message, no response from server when I try to equip bow or view stat of a new item.
Maybe crash cause by range attack calculation whitout stat :p
Maybe crash cause by range attack calculation whitout stat :p
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Crash EQ2Emu :p
Definitely a crash, and in the damn LogWrite again. SCAT!
Why is this wrong?
Not only is COMBAT__DETAIL off, but the name's are c_str()'d so why is this crashing world?
Commenting out for now.
Edit: Ohhh.... if Alfa unequipped both weapon and ammo, there would be no values. Is this the issue? and, would this fix it?
But, the more important question:
Why is this logger crashing when COMBAT__DETAIL is disabled?
Why is this wrong?
Code: Select all
if(fighter->IsPlayer())
{
weapon = ((Player*)fighter)->GetEquipmentList()->GetItem(EQ2_RANGE_SLOT);
ammo = ((Player*)fighter)->GetEquipmentList()->GetItem(EQ2_AMMO_SLOT);
LogWrite(COMBAT__DETAIL, "Combat", "Weapon '%s', Ammo '%s'", weapon->name.c_str(), ammo->name.c_str());
}Commenting out for now.
Edit: Ohhh.... if Alfa unequipped both weapon and ammo, there would be no values. Is this the issue? and, would this fix it?
Code: Select all
LogWrite(COMBAT__DETAIL, "Combat", "Weapon '%s', Ammo '%s'", ( weapon )? weapon->name.c_str() : "None", ( ammo ) ? ammo->name.c_str() : "None");But, the more important question:
Why is this logger crashing when COMBAT__DETAIL is disabled?
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Re: Crash EQ2Emu :p
Yes thats the appropriate fix. Not sure why its crashing there. Im stuck in philly this weekend moving my girlfriend to a new apartment and painting and all that jazz so i will get to it on monday.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Crash EQ2Emu :p
I've already fixed and committed it. Hoping Alfa will try that action to see if he can get it to crash again.
Scat, you know the rules on "no girlfriends", they are a detriment to EQ2Emulator's progress
Scat, you know the rules on "no girlfriends", they are a detriment to EQ2Emulator's progress
- alfa
- Team Member
- Posts: 550
- Joined: Fri Jul 27, 2007 6:24 pm
- Location: France
- Contact:
Re: Crash EQ2Emu :p
Well it seem to be ok
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Re: Crash EQ2Emu :p
Yes i know. I keep her locked in the basement but as a x4 raid mob she escaped and i couldnt take her down soloJohn Adams wrote:I've already fixed and committed it. Hoping Alfa will try that action to see if he can get it to crash again.
Scat, you know the rules on "no girlfriends", they are a detriment to EQ2Emulator's progress
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Crash EQ2Emu :p
Noob.Scatman wrote:Yes i know. I keep her locked in the basement but as a x4 raid mob she escaped and i couldnt take her down solo
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Re: Crash EQ2Emu :p
This was crashing because even though COMBAT__DETAIL is disabled, you're still trying to access a function of a NULL object. So since the variable 'ammo' was null, calling c_str() on a NULL pointer resulted in a crash. This is because it needs to call c_str() before LogWrite() can even get called, so it never even got into the LogWrite() function.
So adding the check for ammo==NULL is the appropriate and only fix we need here.
So adding the check for ammo==NULL is the appropriate and only fix we need here.
Who is online
Users browsing this forum: No registered users and 0 guests