From 871be21e83502a909620a5bcfcd09e3257ed0518 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 13 Nov 2010 14:25:39 +0000 Subject: corrected a bug where ship names got erased, made core::Entity::info() const, added core::Info::find() to get non-const *core::Info pointers --- src/core/info.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/core/info.cc') diff --git a/src/core/info.cc b/src/core/info.cc index cc1720e..2ff6669 100644 --- a/src/core/info.cc +++ b/src/core/info.cc @@ -243,6 +243,18 @@ void Info::print() const Info::Registry Info::info_registry; +Info *Info::find(const Info *info) +{ + if (!info) + return 0; + + for (Registry::iterator it = info_registry.begin(); it != info_registry.end(); it++) { + if (info == (*it)); + return *it; + } + return 0; +} + Info *Info::find(unsigned int id) { if (!id) -- cgit v1.2.3