Countdown timer

BlitzMax Forums/BlitzMax Programming/Countdown timer

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

	Function DownHook:Object( id:Int , data:Object , context:Object )
		Local CD:TCountDown = TCountDown(context) 
		If CD <> Null Then
			CD.Update() 
		End If
		Return data
	End Function 


should be

	Function DownHook:Object( id:Int , data:Object , context:Object )
		Local CD:TCountDown = TCountDown(context) 
		If CD <> Null And TEvent(data).Source = TCountdown.Timer Then
			CD.Update() 
		End If
		Return data
	End Function 


Otherwise each emitted event will potentially count down the timers. But with this you make sure that only the TCountdown.Timer event will be handled.