Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



This topic is 5114 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

void floatfunc(float);
int l = 1;

floatfunc(l * 0.2);
The parameter in the function call is evaluated as an integer, not a float. Shouldn''t it be the other way around? On that note, is there anyway to typecast in angelscript? As a workaround I''m using my own toInt and toFloat functions that I expose to AS. - Xavier

Share this post

Link to post
Share on other sites
The scripting language doesn't do any implicit casting of variable types. Which is why the value is evaluated as integer.

That said, I think the correct way would be to have the compiler give a warning that the float is implicitly cast to integer. Or perhaps even an error. I might change this for future versions of AngelScript.

www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game

[edited by - WitchLord on May 27, 2004 6:54:25 AM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!