Possible Bash Bug in 3.61

Login to reply  Page: « < 1 of 1 > »
15 May 2010 - 14:082595
Possible Bash Bug in 3.61
Hand-Patching my codebase to 3.61 and got to the act.offensive.c file and it has us do the following:

-  percent = rand_number(1, 101);	/* 101% is a complete failure */
-  prob = GET_SKILL(ch, SKILL_BASH);
+  if (MOB_FLAGGED(vict, MOB_NOKILL)) {
+    send_to_char(ch, "This mob is protected.\r\n");
+    return;
+  }
 
   if (MOB_FLAGGED(vict, MOB_NOBASH))
     percent = 101;
 
+  percent = rand_number(1, 101);	/* 101% is a complete failure */
+  prob = GET_SKILL(ch, SKILL_BASH);
+

But if I'm reading this right, won't that make all mobs that are !Bash, become bash-able by setting percent to 101 if they are !Bash, and then setting percent to a random number?

Should this not read:
+  if (MOB_FLAGGED(vict, MOB_NOKILL)) {
+    send_to_char(ch, "This mob is protected.\r\n");
+    return;
+  }

  percent = rand_number(1, 101);	/* 101% is a complete failure */
  prob = GET_SKILL(ch, SKILL_BASH);

 
   if (MOB_FLAGGED(vict, MOB_NOBASH))
     percent = 101;
 

anderyu


__________________
I'm not racist, I hate everyone equally.
16 May 2010 - 18:182596
Nice catch, thanks.


__________________
Rumble
The Builder Academy
tbamud.com 9091
Login to reply  Page: « < 1 of 1 > »