Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-11-14 14:14:21 +0000
committerStijn Buys <ingar@osirion.org>2009-11-14 14:14:21 +0000
commit4293e8854a30443e4d5818fc55df404976dbfd9b (patch)
tree816665ba37acfd5a39c0544c3b2acbf04c8c5d3d /src/core/gameconnection.cc
parenta993d31910b63a1f897e470842934e6ffefad32c (diff)
update the info system, fixes network info exchange
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...");