Thread: Combat Fixes
View Single Post
  #1  
Old 09-18-2008, 03:24 AM
James76
Sarnak
 
Join Date: Sep 2008
Location: Canada
Posts: 53
Smile Combat Fixes

I am resolved to fix combat, I hope everyone can accept these changes. I started by making the code more readable, by simply adding extra lines here and there so that the curly braces weren't compacting the code so much. Then I fixed all the signed/unsigned comparison warnings, then all the type conversions (int to float comparisons) using static_cast where applicable. Now there are no compile warnings. I replaced any "x++" with "++x" for example, because its actually faster and you only need the post-increment on something like "myarray[x++]" which increments x after reading from the array, or "myarray[++x]" which increments x before reading from the array. Its faster because the post-increment has to push the value to return on the stack before incrementing.

Also, I found some bugs in bonus damage where it essentially gets trimmed because of type conversions, as well as a huge bug in bonus damage (for example, monks get +20% damage output) but it wasn't applying correctly.. essentially because of faulty math. These things jump out at me, and had to be addressed. There was a problem with item damageshields not applying to combat unless you also had a spell damageshield on, which is now fixed. I am still working at getting the ripostes working per attack gracefully, I fixed it a few different ways but I'm not happy, I want proper messaging too. Also I'm going to get monk FD working properly since its in the same file, I had a look at it and it seems proper but obviously its not working.

This list of fixes will have to replace the entire ./zone/attack.cpp file, I've made too many adjustments to list as it is.

Expect future posts shortly... I'll eventually provide a link to the new file, with which you can do a diff or use whatever comb you like. I won't post it until I've tested it to my satisfaction, and I'm sure you'll all be happy with my testing.
__________________
Expert developer, I do it for a living.
Don't let the "Junior" tag fool you.
Reply With Quote