diff options
author | Your Name <you@example.com> | 2023-11-22 15:28:00 -0500 |
---|---|---|
committer | Your Name <you@example.com> | 2023-11-22 15:28:00 -0500 |
commit | ae68e84557a7e56fd7210c1009aa1313dcc78adf (patch) | |
tree | 60616c822927847dd078f014c514a65f764607f3 /src/entry.cc | |
parent | 0d32e0d3342ef2455014c8e1164977c816763317 (diff) | |
download | dmtool-ae68e84557a7e56fd7210c1009aa1313dcc78adf.tar.gz dmtool-ae68e84557a7e56fd7210c1009aa1313dcc78adf.tar.bz2 dmtool-ae68e84557a7e56fd7210c1009aa1313dcc78adf.zip |
Increased capacity for creating items from command line
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(); } |