Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/gameconnection.cc')
-rw-r--r--src/core/gameconnection.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/core/gameconnection.cc b/src/core/gameconnection.cc
index 064974c..8910bca 100644
--- a/src/core/gameconnection.cc
+++ b/src/core/gameconnection.cc
@@ -92,18 +92,21 @@ bool GameConnection::interactive() const
Info *GameConnection::info(const std::string &type, const std::string &label)
{
- // find the class
+ // find the info record type
InfoType *infotype = InfoType::find(type);
- if (!infotype)
- return 0;
+ if (!infotype) {
+ // create a new info record type and set the label
+ infotype = new InfoType(type.c_str());
+ }
- // check if we already have the info record
+ // find the info record
Info *info = Info::find(infotype, label);
- if (info)
+ if (info) {
return info;
-
- // create a new information record and set the label
- info = new Info(0);
+ }
+
+ // create a new info record and set the label
+ info = new Info(infotype);
info->set_label(label);
info->text().push_back("Requesting information...");