|
@@ -58,20 +58,23 @@ void harry_idle_event(int fd) {
|
|
int total_possible =
|
|
int total_possible =
|
|
have_userinfo ? total_phrases + total_user_phrases : total_phrases;
|
|
have_userinfo ? total_phrases + total_user_phrases : total_phrases;
|
|
|
|
|
|
- ZF_LOGD("%d total %d console @ %d,%d", have_userinfo, total_possible,
|
|
|
|
- console.posx, console.posy);
|
|
|
|
do {
|
|
do {
|
|
r = randint(total_possible);
|
|
r = randint(total_possible);
|
|
} while (last_seen_harry_event.seen_before(r));
|
|
} while (last_seen_harry_event.seen_before(r));
|
|
|
|
|
|
|
|
+ ZF_LOGD("have %d picked %d total %d console @ %d,%d", have_userinfo, r,
|
|
|
|
+ total_possible, console.posx, console.posy);
|
|
|
|
+
|
|
std::string selected;
|
|
std::string selected;
|
|
- if (r > total_phrases) {
|
|
|
|
|
|
+ if (r >= total_phrases) {
|
|
selected = user_phrases[r - total_phrases];
|
|
selected = user_phrases[r - total_phrases];
|
|
replace(selected, "USER", fullname);
|
|
replace(selected, "USER", fullname);
|
|
replace(selected, "NICK", username);
|
|
replace(selected, "NICK", username);
|
|
} else
|
|
} else
|
|
selected = phrases[r];
|
|
selected = phrases[r];
|
|
|
|
|
|
|
|
+ ZF_LOGD("Selected: %s", selected.c_str());
|
|
|
|
+
|
|
int color = randint(15) + 1;
|
|
int color = randint(15) + 1;
|
|
// %02d = std::setfill('0') << std::setw(2) << (int)
|
|
// %02d = std::setfill('0') << std::setw(2) << (int)
|
|
/*
|
|
/*
|