Update triggerbox RNG API calls
This commit is contained in:
parent
a3b28b4114
commit
55211b8dd6
@ -989,7 +989,7 @@ TriggerBox::set_next_trigger (size_t current)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int which_follow_action;
|
int which_follow_action;
|
||||||
int r = _pcg.rand (0, 101);
|
int r = _pcg.rand (100); // 0 .. 99
|
||||||
|
|
||||||
if (r <= all_triggers[current]->follow_action_probability()) {
|
if (r <= all_triggers[current]->follow_action_probability()) {
|
||||||
which_follow_action = 0;
|
which_follow_action = 0;
|
||||||
@ -1077,7 +1077,7 @@ TriggerBox::set_next_trigger (size_t current)
|
|||||||
|
|
||||||
case Trigger::AnyTrigger:
|
case Trigger::AnyTrigger:
|
||||||
while (true) {
|
while (true) {
|
||||||
n = _pcg.rand (0, all_triggers.size() + 1);
|
n = _pcg.rand (all_triggers.size());
|
||||||
if (!all_triggers[n]->region()) {
|
if (!all_triggers[n]->region()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1091,7 +1091,7 @@ TriggerBox::set_next_trigger (size_t current)
|
|||||||
|
|
||||||
case Trigger::OtherTrigger:
|
case Trigger::OtherTrigger:
|
||||||
while (true) {
|
while (true) {
|
||||||
n = _pcg.rand (0, all_triggers.size() + 1);
|
n = _pcg.rand (all_triggers.size());
|
||||||
if ((size_t) n == current) {
|
if ((size_t) n == current) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user