diff options
author | Stijn Buys <ingar@osirion.org> | 2009-11-14 14:14:21 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-11-14 14:14:21 +0000 |
commit | 4293e8854a30443e4d5818fc55df404976dbfd9b (patch) | |
tree | 816665ba37acfd5a39c0544c3b2acbf04c8c5d3d /src/core/gameconnection.cc | |
parent | a993d31910b63a1f897e470842934e6ffefad32c (diff) |
update the info system, fixes network info exchange
Diffstat (limited to 'src/core/gameconnection.cc')
-rw-r--r-- | src/core/gameconnection.cc | 19 |
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..."); |