aboutsummaryrefslogtreecommitdiff
path: root/src/entry.cc
diff options
context:
space:
mode:
authorYour Name <you@example.com>2023-11-22 15:28:00 -0500
committerYour Name <you@example.com>2023-11-22 15:28:00 -0500
commitae68e84557a7e56fd7210c1009aa1313dcc78adf (patch)
tree60616c822927847dd078f014c514a65f764607f3 /src/entry.cc
parent0d32e0d3342ef2455014c8e1164977c816763317 (diff)
downloaddmtool-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.cc5
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();
}