Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Commands->Get_Random_Int() is of very poor quality
Re: Commands->Get_Random_Int() is of very poor quality [message #473089 is a reply to message #473077] Sun, 12 August 2012 15:14 Go to previous message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma:
General (4 Stars)
RealLow + (Random2Class__operator__(FreeRandom) & 0x7FFFFFFF) % (RealHigh - RealLow);


if RealLow = 1 and RealHigh = 2 we get

 1 + random number % (2 - 1)


Which always returns 1 as anything modulus (2-1) is 0, 0 + 1 = 1.


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Crash dump
Next Topic: flame tank right click
Goto Forum:
  


Current Time: Sun Dec 22 18:40:00 MST 2024

Total time taken to generate the page: 0.01568 seconds