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.