[hlcoders] Round remaining time

2008-12-16 Thread Yorg Kuijs
Hey list, maybe a stupid question but don't know whats wrong.. My mod uses round based play, so besides a Maptime it has roundtime as well, I copied the maptimeremaining function and so have a roundtimeremaining function, works FINE. But now I have a float(can be an int too) to start

Re: [hlcoders] Round remaining time

2008-12-16 Thread Rodrigo 'r2d2rigo' Diaz
Don't use == for time comparations, because you won't call the function at the EXACT time always. Better use this: if ( GetRoundRemainingTime() = flStartSuddenDeathSound ) { // play sound and enable flag so the sound doesn't get repeated } On Tue, Dec 16, 2008 at 3:36 PM, Yorg Kuijs

Re: [hlcoders] Round remaining time

2008-12-16 Thread Yorg Kuijs
Heh, well got it working now, thanks! Rodrigo 'r2d2rigo' Diaz wrote: Actually, you'd be surprised how common that error is. I fell on it some time ago, too :) ___ To unsubscribe, edit your list preferences, or view the list archives, please

Re: [hlcoders] Round remaining time

2008-12-16 Thread Rodrigo 'r2d2rigo' Diaz
Actually, you'd be surprised how common that error is. I fell on it some time ago, too :) On Tue, Dec 16, 2008 at 3:56 PM, Yorg Kuijs yorg.ku...@home.nl wrote: I thought so, but weird thing is that 30 always works the first time. oh well, I'll go do that then! Should have thought of it...

Re: [hlcoders] Round remaining time

2008-12-16 Thread Mack Corl
My guess is that you're running into precision issues when you are comparing the two floats, and that GetRoundRemainingTime() isn't returning exactly 35 or 40 or whatever. What happens if you try: if( GetRoundRemainingTime() = flStartSuddenDeathSound ) ? -Mack On Tue, Dec 16, 2008 at 9:36 AM,