mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 15:00:25 +00:00
Switch random function to std::mt19937
Added class EQEmu::Random Functions: EQEmu::Random::Int(int low, int high) EQEmu::Random::Real(double low, double high) EQEmu::Random::Roll(int required) EQEmu::Random::Roll(double required) EQEmu::Random::Reseed() For zone, you will access the random object through the zone object ex. zone->random.Int(0, 100); Int returns a random int between low and high Real returns a random double between low and high Roll(int) returns true if Int(0, 99) < required is true Roll(double) returns true if Real(0.0, 1.0) <= required is true
This commit is contained in:
+2
-2
@@ -441,8 +441,8 @@ void Object::RandomSpawn(bool send_packet) {
|
||||
if(!m_ground_spawn)
|
||||
return;
|
||||
|
||||
m_data.x = MakeRandomFloat(m_min_x, m_max_x);
|
||||
m_data.y = MakeRandomFloat(m_min_y, m_max_y);
|
||||
m_data.x = zone->random.Real(m_min_x, m_max_x);
|
||||
m_data.y = zone->random.Real(m_min_y, m_max_y);
|
||||
respawn_timer.Disable();
|
||||
|
||||
if(send_packet) {
|
||||
|
||||
Reference in New Issue
Block a user