🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Asserion failure compiling a weird ternery statement

Started by
2 comments, last by WitchLord 7 months, 3 weeks ago

Getting an assertion failure when the last number in this statement is a float/double, but not if it's an int (the only difference is the period after the ‘2’).

m_NewGhostOffset is an int
lastLoadedGhostRaceTime is a uint
Math::Clamp(x, min, max) is an overloaded function that takes either all ints or all floats

fails:
m_NewGhostOffset = Math::Clamp(m_NewGhostOffset, 0, lastLoadedGhostRaceTime == 0 ? 9999999 : lastLoadedGhostRaceTime * 2.);

works:
m_NewGhostOffset = Math::Clamp(m_NewGhostOffset, 0, lastLoadedGhostRaceTime == 0 ? 9999999 : lastLoadedGhostRaceTime * 2);

Advertisement

Thanks, I'll investigate and fix this

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I've fixed this in rev 2869.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement