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>2010-11-13 14:25:39 +0000
committerStijn Buys <ingar@osirion.org>2010-11-13 14:25:39 +0000
commit871be21e83502a909620a5bcfcd09e3257ed0518 (patch)
tree8aee5b25fd5c3d43e55e1b92e114acca58c1172a /src/game/base/jumppoint.cc
parent650cca5da5e15b9d4a85e7f734515f538b0cc0f3 (diff)
corrected a bug where ship names got erased,
made core::Entity::info() const, added core::Info::find() to get non-const *core::Info pointers
Diffstat (limited to 'src/game/base/jumppoint.cc')
-rw-r--r--src/game/base/jumppoint.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/game/base/jumppoint.cc b/src/game/base/jumppoint.cc
index 8af39b0..e52873e 100644
--- a/src/game/base/jumppoint.cc
+++ b/src/game/base/jumppoint.cc
@@ -79,11 +79,14 @@ void JumpPoint::validate()
}
set_name(name);
- if (!info()) {
- set_info(new core::Info(core::Entity::infotype(), label().c_str()));
+ // info is const, core::Info::find returns a non-const pointer
+ core::Info *entity_info = core::Info::find(info());
+ if (!entity_info) {
+ entity_info = new core::Info(core::Entity::infotype(), label().c_str());
+ set_info(entity_info);
}
- info()->clear_text();
- info()->add_text("Jumppoint to the " + target()->zone()->name());
+ entity_info->clear_text();
+ entity_info->add_text("Jumppoint to the " + target()->zone()->name());
con_debug << " " << label() << " jumppoint to " << target()->zone()->label() << ":" << target()->label() << std::endl;
@@ -119,8 +122,9 @@ void JumpGate::validate()
}
set_name(name);
- info()->clear_text();
- info()->add_text("Jumpgate to the " + target()->zone()->name());
+ core::Info *entity_info = core::Info::find(info());
+ entity_info->clear_text();
+ entity_info->add_text("Jumpgate to the " + target()->zone()->name());
if (target()) {
set_flag(core::Entity::Dockable);