Advertisement

Asserion failure compiling a weird ternery statement

Started by October 12, 2023 02:53 AM
2 comments, last by WitchLord 1 year, 2 months 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);

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

Advertisement

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