again
Some checks failed
Build / Build Game (push) Has been cancelled

This commit is contained in:
2026-02-28 22:19:24 -05:00
parent acb1505308
commit 3817f1cc39
3 changed files with 22 additions and 13 deletions

View File

@@ -156,7 +156,12 @@ namespace game::resource::xml
}
}
int Dialogue::Pool::get() const { return this->at(math::random_max(this->size())); }
int Dialogue::Pool::get() const
{
if (this->empty()) return -1;
auto index = rand() % this->size();
return this->at(index);
}
Dialogue::Entry* Dialogue::get(int id) { return &entries.at(id); }
Dialogue::Entry* Dialogue::get(Dialogue::EntryReference& entry) { return &entries.at(entry.id); }
Dialogue::Entry* Dialogue::get(const std::string& string) { return &entries.at(entryIDMap.at(string)); }