- Katılım
- 8 Ocak 2011
- Konular
- 399
- Mesajlar
- 2,667
- Çözüm
- 24
- Online süresi
- 2mo 28d
- Reaksiyon Skoru
- 685
- Altın Konu
- 4
- Başarım Puanı
- 252
- MmoLira
- 6,627
- DevLira
- 51
ROHAN2 WORLD 1-120 TR TİPİ OFFICIAL YOHARA, BALATHOR VE AMON! 80. GÜNÜNDE! +10.000 ONLİNE! HİLE VE BOT %100 ENGELLİ HEMEN TIKLA!
flatik'den alıntıdır...
Windows ortamında kullanıyorsanız filesinizi, %100 düşme şansının fix'i
Öncesi:
Sonrası:
[CODE lang="cpp" title="../libthecore/src/utils.c(xx) İlk satırlarda uygun yere ekle"]#include <random>[/CODE]
[CODE lang="cpp" title="../libthecore/src/utils.c(xx) 'de bu fonksiyonu bul."]int number_ex(int from, int to, const char *file, int line)
{
if (from > to)
{
int tmp = from;
sys_err("number(): first argument is bigger than second argument %d -> %d, %s %d", from, to, file, line);
from = to;
to = tmp;
}
int returnValue = 0;
if ((to - from + 1) != 0)
returnValue = ((thecore_random() % (to - from + 1)) + from);
else
sys_err("number(): devided by 0");
return returnValue;
}
[/CODE]
[CODE lang="cpp" title="Bununla değiştir:"]
int number_ex(int from, int to, const char* file, int line)
{
if (from > to)
{
int tmp = from;
sys_err("number(): first argument is bigger than second argument %d -> %d, %s %d", from, to, file, line);
from = to;
to = tmp;
}
int returnValue = 0;
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<> distrib(from, to);
if ((to - from + 1) != 0)
returnValue = distrib(gen);
else
sys_err("number(): devided by 0");
return returnValue;
}
[/CODE]
[CODE lang="cpp" title="Daha optimize Alternatif:"]int number_ex(int from, int to, const char *file, int line)
{
// We only need (and want) to initialize the mersenne twister generator once
static std::random_device rd;
static std::mt19937 mt(rd());
static std::uniform_int_distribution<int> dist; // not too expensive to create, though
if (from > to)
{
int tmp = from;
sys_err("number(): first argument is bigger than second argument %d -> %d, %s %d", from, to, file, line);
from = to;
to = tmp;
}
// Set the range we'd like our distribution to be on, and generate the number
return dist(mt, std::uniform_int_distribution<int>:
aram_type(from, to));
}[/CODE]
Windows ortamında kullanıyorsanız filesinizi, %100 düşme şansının fix'i
Öncesi:
Sonrası:
[CODE lang="cpp" title="../libthecore/src/utils.c(xx) İlk satırlarda uygun yere ekle"]#include <random>[/CODE]
[CODE lang="cpp" title="../libthecore/src/utils.c(xx) 'de bu fonksiyonu bul."]int number_ex(int from, int to, const char *file, int line)
{
if (from > to)
{
int tmp = from;
sys_err("number(): first argument is bigger than second argument %d -> %d, %s %d", from, to, file, line);
from = to;
to = tmp;
}
int returnValue = 0;
if ((to - from + 1) != 0)
returnValue = ((thecore_random() % (to - from + 1)) + from);
else
sys_err("number(): devided by 0");
return returnValue;
}
[/CODE]
[CODE lang="cpp" title="Bununla değiştir:"]
int number_ex(int from, int to, const char* file, int line)
{
if (from > to)
{
int tmp = from;
sys_err("number(): first argument is bigger than second argument %d -> %d, %s %d", from, to, file, line);
from = to;
to = tmp;
}
int returnValue = 0;
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<> distrib(from, to);
if ((to - from + 1) != 0)
returnValue = distrib(gen);
else
sys_err("number(): devided by 0");
return returnValue;
}
[/CODE]
[CODE lang="cpp" title="Daha optimize Alternatif:"]int number_ex(int from, int to, const char *file, int line)
{
// We only need (and want) to initialize the mersenne twister generator once
static std::random_device rd;
static std::mt19937 mt(rd());
static std::uniform_int_distribution<int> dist; // not too expensive to create, though
if (from > to)
{
int tmp = from;
sys_err("number(): first argument is bigger than second argument %d -> %d, %s %d", from, to, file, line);
from = to;
to = tmp;
}
// Set the range we'd like our distribution to be on, and generate the number
return dist(mt, std::uniform_int_distribution<int>:
aram_type(from, to));}[/CODE]
- Katılım
- 25 Ocak 2019
- Konular
- 39
- Mesajlar
- 1,071
- Çözüm
- 15
- Online süresi
- 7mo 8d
- Reaksiyon Skoru
- 829
- Altın Konu
- 0
- Başarım Puanı
- 231
- MmoLira
- 15,195
- DevLira
- 30
Paylaşım için teşekkürler.
- Katılım
- 17 Tem 2018
- Konular
- 533
- Mesajlar
- 3,963
- Çözüm
- 34
- Online süresi
- 11mo 8d
- Reaksiyon Skoru
- 1,769
- Altın Konu
- 50
- TM Yaşı
- 7 Yıl 10 Ay 25 Gün
- Başarım Puanı
- 327
- MmoLira
- 9,296
- DevLira
- 45
Paylaşım için teşekkürler.
Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)
Benzer konular
- Cevaplar
- 5
- Görüntüleme
- 670
- Cevaplar
- 8
- Görüntüleme
- 1K
- Cevaplar
- 15
- Görüntüleme
- 2K




