View Single Post
  #10  
Old 02-26-2014, 11:46 AM
wolfwalkereci
Discordant
 
Join Date: Dec 2005
Posts: 435
Default

Just came across this issue this morning and was curious if it would be cleaner to do this:
Code:
                    int distance =    sqrt((double)
                                    ((int(GetX()) - buffs[slot].caston_x) * (int(GetX()) - buffs[slot].caston_x)) + 
                                    ((int(GetY()) - buffs[slot].caston_y) *  (int(GetY()) - buffs[slot].caston_y)) +
                                    ((int(GetZ()) - buffs[slot].caston_z) * (int(GetZ()) - buffs[slot].caston_z)) 
                                    );
Not something I am knowledgeable about in the least. Most of the google results recommended explicit type casting.
This way does compile but I have no idea if it actually works, I do not have a test server setup at this time.
Reply With Quote