diff options
author | Stijn Buys <ingar@osirion.org> | 2010-11-12 16:24:17 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-11-12 16:24:17 +0000 |
commit | b460b3193e54b7364bb75ff26ce6f999887e454b (patch) | |
tree | d35e4972fd3ee54b9922908e3791a53bae96af14 /src/game/base/jumppoint.cc | |
parent | c0c2a0ccc335b00983bf69b99b7a44505ed24b47 (diff) |
moved global entity info type to core::Entity::infotype(),
automatic generation of jumppoint and jumpgate names and descriptions,
prepared game code for the seperation of Entity::radius() and Model::radius()
Diffstat (limited to 'src/game/base/jumppoint.cc')
-rw-r--r-- | src/game/base/jumppoint.cc | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/game/base/jumppoint.cc b/src/game/base/jumppoint.cc index 82ed489..8af39b0 100644 --- a/src/game/base/jumppoint.cc +++ b/src/game/base/jumppoint.cc @@ -71,9 +71,22 @@ void JumpPoint::validate() } jumppoint_target = static_cast<JumpPoint *>(targetentity); + + // overwrite name and info, remove the "system" part from the name + std::string name("Jumppoint " + zone()->name() + " -> " + target()->zone()->name()); + for (size_t pos = name.find(" system"); pos != std::string::npos; pos = name.find(" system")) { + name.erase(pos, 7); + } + set_name(name); + + if (!info()) { + set_info(new core::Info(core::Entity::infotype(), label().c_str())); + } + info()->clear_text(); + info()->add_text("Jumppoint to the " + target()->zone()->name()); + - con_debug << " jumppoint to " << targetzone->label() << std::endl; - //con_debug << " Jumppoint " << zone->label() << ":" << label() << " with target " << targetlabel() << std::endl; + con_debug << " " << label() << " jumppoint to " << target()->zone()->label() << ":" << target()->label() << std::endl; } /* ---- class JumpGate --------------------------------------------- */ @@ -97,6 +110,18 @@ JumpGate::~JumpGate() void JumpGate::validate() { JumpPoint::validate(); + + // overwrite name and info + // overwrite name and info, remove the "system" part from the name + std::string name("Jumpgate " + zone()->name() + " -> " + target()->zone()->name()); + for (size_t pos = name.find(" system"); pos != std::string::npos; pos = name.find(" system")) { + name.erase(pos, 7); + } + set_name(name); + + info()->clear_text(); + info()->add_text("Jumpgate to the " + target()->zone()->name()); + if (target()) { set_flag(core::Entity::Dockable); } else { |