Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug with weaponspeed patch



Here is the patch for truncating weapon speed at zero.
Before, a dagger + 4 would try to give a player a weaponspeed of -1
but since weaponspeed was an unsigned char, it wrapped and gave them a speed
of 255.  I don't see any real reason for weapon speeds FASTER than bare hands,
so, here is the patch.

---JT
-------------------- cut here-----------------------------
*** living.c.old	Wed Sep  9 17:07:23 1992
--- living.c	Wed Sep  9 17:17:22 1992
***************
*** 69,75 ****
      return 1;
    if(tmp->type==WEAPON)
      if(flag==1)
!       op->contr->weapon_sp=(unsigned char)WEAPON_SPEED(tmp)-tmp->magic;
      else
        op->contr->weapon_sp=0;
    if(tmp->stats.hp) {
--- 69,78 ----
      return 1;
    if(tmp->type==WEAPON)
      if(flag==1)
!       if(((int)WEAPON_SPEED(tmp) - (int)tmp->magic) > 0)
!         op->contr->weapon_sp=(unsigned char)WEAPON_SPEED(tmp)-tmp->magic;
!       else
!         op->contr->weapon_sp = 0;
      else
        op->contr->weapon_sp=0;
    if(tmp->stats.hp) {
------------------- cut here -----------------------------
-------------------------------------------------------------------------
Practice random kindness and senseless acts of beauty --Anonymous
Argue for your limitations and sure enough they're yours --Richard Bach

Moonchilde/Amythyst/JT Traub ---           jtraub@cmu.edu