View Single Post
Kevin_b_er
SourceMod Donor
Join Date: Feb 2009
Old 02-01-2011 , 17:18   Re: [TF2] Dodge & Resist
Reply With Quote #10

Quote:
Originally Posted by psychonic View Post
@ Tylerist

Code:
new Float:resist = 1.0 - (damageresist[victim]/100.0);

Is this giving the intended result? You're dividing an integer by a float.
I think it should be:
Code:
new Float:resist = 1.0 - (float(damageresist[victim])/100.0);
Not an issue.

Code:
stock Float:operator/(oper1, Float:oper2)
{
    return FloatDiv(float(oper1), oper2);
}
What's more float/int or int/float will result in an int in most C-style languages. In this case, sourcepawn is no different.
__________________
Kevin_b_er is offline