Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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);