Log in

View Full Version : Client freezes - clickable items


AndMetal
02-23-2008, 07:15 PM
Original post (http://andmetal.net/smforum/index.php?topic=53.msg192) (external link)

It seems that if there is an item that has a casttime less than -1, it causes the client to freeze (can't cast other spells, usually can't log out, etc). I believe it's because there isn't really a check against negative casting times.

I think I've narrowed it down to the following code:

zone/spells.cpp (http://eqemulator.cvs.sourceforge.net/eqemulator/EQEmuCVS/Source/zone/spells.cpp?view=markup#l_257):

257 bool Mob::DoCastSpell(int16 spell_id, int16 target_id, int16 slot,
258 sint32 cast_time, sint32 mana_cost, int32* oSpellWillFinish, int32 item_slot)

298 if(cast_time == -1) {
299 // save the non-reduced cast time to use in the packet
300 cast_time = orgcasttime = spell.cast_time;
301 // if there's a cast time, check if they have a modifier for it
302 if(cast_time)
303 {
304 cast_time = GetActSpellCasttime(spell_id, cast_time);
305
306 }
307 }
308 else
309 orgcasttime = cast_time;


If I'm not mistaken, if line 298 is changed to
if(cast_time <= -1) {
that should fix the issue. Then again, the calculation for the casting time might be in GetActSpellCasttime(), which I think is in zone/mob.cpp (http://eqemulator.cvs.sourceforge.net/eqemulator/EQEmuCVS/Source/zone/mob.cpp?view=markup#l_2198).