View Single Post
  #46  
Old 04-27-2011, 04:18 PM
ZaltysZ's Avatar
ZaltysZ ZaltysZ is offline
Approved Member
 
Join Date: Sep 2008
Location: Lithuania
Posts: 426
Default

Quote:
Originally Posted by Ataros View Post
if (Time.tickCounter() % 72000 == 72000) is wrong probably.
This will always result in FALSE. % gives you a remainder of division (Остаток от деления), so this operation will always give result greater or equal to 0 and less than divisor (assuming positive numbers).

Code:
if (Time.tickCounter() % 72000 == 0)
Will be TRUE every time tickCounter() returns multiple of 72000 (i.e. every time 72000 ticks pass, when counted from 0: 72000, 2*72000, 3*72000 and so on).

Last edited by ZaltysZ; 04-27-2011 at 04:21 PM.
Reply With Quote