EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Bug Reports (https://www.eqemulator.org/forums/forumdisplay.php?f=591)
-   -   Thrown weapons crash bug (https://www.eqemulator.org/forums/showthread.php?t=20180)

BatCountry 03-08-2006 08:12 AM

Thrown weapons crash bug
 
Please note this only crashes in Debug compiles of zoneperl 6.5-X

There is a problem in special_attacks.cpp:

in function Client::ThrowingAttack(Mob* other)

line 808:
Code:

        DeleteItemInInventory(ammo_slot, 1, true);
Where it deletes one from a stack of ranged ammunition.

If you have only one of a type of item, you throw the item, it's deleted, then it moves on to do damage calculations.

However, it's reading from deleted memory. In debug compiles (MSVS .NET 2003) it crashes with a segmentation violation on line 855:
Code:

        TryWeaponProc(RangeWeapon, target);
(tested with "a vile substance" thrown from ranged slot)

If you move lines 807 and 808
Code:

        //consume ammo
        DeleteItemInInventory(ammo_slot, 1, true);

to the bottom of the method or just above line 862
Code:

        CheckIncreaseSkill(THROWING);
It will fix this behavior (tested).

-BatCountry
EsOEQ

fathernitwit 03-08-2006 01:49 PM

hey, good catch. I kept seeing this crash, but never spent the time to figure out what was wrong. Change will be in CVS when I get to it.


All times are GMT -4. The time now is 11:18 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.