mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
Add Random::Roll0
This has the same interval ((0,N]) that the client function does The devs have referenced this in a few posts talking about mechanics.
This commit is contained in:
parent
630ea0d3c6
commit
1d19bd11d0
@ -65,6 +65,15 @@ namespace EQEmu {
|
|||||||
return Real(0.0, 1.0) <= required;
|
return Real(0.0, 1.0) <= required;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// same range as client's roll0
|
||||||
|
// This is their main high level RNG function
|
||||||
|
int Roll0(int max)
|
||||||
|
{
|
||||||
|
if (max - 1 > 0)
|
||||||
|
return Int(0, max - 1);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// std::shuffle requires a RNG engine passed to it, so lets provide a wrapper to use our engine
|
// std::shuffle requires a RNG engine passed to it, so lets provide a wrapper to use our engine
|
||||||
template<typename RandomAccessIterator>
|
template<typename RandomAccessIterator>
|
||||||
void Shuffle(RandomAccessIterator first, RandomAccessIterator last)
|
void Shuffle(RandomAccessIterator first, RandomAccessIterator last)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user