From ae68e84557a7e56fd7210c1009aa1313dcc78adf Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 22 Nov 2023 15:28:00 -0500 Subject: Increased capacity for creating items from command line --- src/entry.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/entry.cc') 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(); } -- cgit v1.2.3