Jump to content

[HELP] ServerSource, results with decimals (0.5)


Recommended Posts

Hi, i need to make this result with decimals in char_battle.cpp

dam *= 1.2 + (iTestDamage / 100);

if the result of (iTestDamage/100) is 0 then the damage is applied correctly for 1.2, but if the result of iTestDamage is 0.3, the dam will not be 1.5 but it is still 1.2

If the result of iTestDamage is 1.0 then the dam is 2.2

How can i make that the result of (iTestDamage/100) is applied with decimals and not truncated to 0 ?

Thank you

 

EDIT: solved, i just needed to use 100.0f

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.