mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-30 22:06:46 +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:
+4
-2
@@ -4,6 +4,7 @@
|
||||
#include "../common/rulesys.h"
|
||||
#include "../common/misc_functions.h"
|
||||
#include "../common/string_util.h"
|
||||
#include "../common/random.h"
|
||||
#include "adventure.h"
|
||||
#include "adventure_manager.h"
|
||||
#include "worlddb.h"
|
||||
@@ -14,6 +15,7 @@
|
||||
extern ZSList zoneserver_list;
|
||||
extern ClientList client_list;
|
||||
extern AdventureManager adventure_manager;
|
||||
extern EQEmu::Random emu_random;
|
||||
|
||||
Adventure::Adventure(AdventureTemplate *t)
|
||||
{
|
||||
@@ -392,8 +394,8 @@ void Adventure::MoveCorpsesToGraveyard()
|
||||
|
||||
for (auto iter = dbid_list.begin(); iter != dbid_list.end(); ++iter)
|
||||
{
|
||||
float x = GetTemplate()->graveyard_x + MakeRandomFloat(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
||||
float y = GetTemplate()->graveyard_y + MakeRandomFloat(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
||||
float x = GetTemplate()->graveyard_x + emu_random.Real(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
||||
float y = GetTemplate()->graveyard_y + emu_random.Real(-GetTemplate()->graveyard_radius, GetTemplate()->graveyard_radius);
|
||||
float z = GetTemplate()->graveyard_z;
|
||||
|
||||
query = StringFormat("UPDATE character_corpses "
|
||||
|
||||
Reference in New Issue
Block a user