diff options
Diffstat (limited to 'src/entry.cc')
-rw-r--r-- | src/entry.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/entry.cc b/src/entry.cc index f958e17..249382f 100644 --- a/src/entry.cc +++ b/src/entry.cc @@ -44,7 +44,10 @@ namespace entry { void Entry::setName(const std::string& name) {data->name = name;} std::string Entry::getEntryType(void) const {return data->entry;} std::string Entry::getType(void) const {return data->type;} - std::string Entry::getText(void) const {return data->text;} + std::string Entry::getText(void) const { + if(!data->text.empty() and data->text.back() == '\n') return data->text.substr(0, data->text.length()-1); // Strip final newline + return data->text; + } std::string Entry::getText(const creature::Creature& c) const { return getName() + " (" + getType() + "): " + getText(); } |