View Single Post
  #1  
Old 02-23-2008, 07:15 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default Client freezes - clickable items

Original post (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:
Code:
  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
Code:
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.
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote