MCPcopy Create free account
hub / github.com/assaultcube/AC / RandomLong

Function RandomLong

source/src/bot/bot_util.cpp:80–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80long RandomLong (long from, long to)
81{
82 // this function returns a random integer number between (and including)
83 // the starting and ending values passed by parameters from and to.
84 if (to <= from)
85 return (from);
86
87 return (from + lrand () / (LRAND_MAX / (to - from + 1)));
88}
89
90float RandomFloat (float from, float to)
91{

Callers 11

AimToIdealMethod · 0.85
GetSelectionMethod · 0.85
FindWaypointMethod · 0.85
HeadToWaypointMethod · 0.85
HuntEnemyMethod · 0.85
DoCombatNavMethod · 0.85
CheckStuckMethod · 0.85
CheckStrafeMethod · 0.85
CheckFOVMethod · 0.85
WaterNavMethod · 0.85
CheckItemsMethod · 0.85

Calls 1

lrandFunction · 0.85

Tested by

no test coverage detected