From f0e1990cbd0cf700959de52a707b1270e5dbd79c Mon Sep 17 00:00:00 2001 From: Toofy Date: Tue, 18 Apr 2023 17:33:29 +0100 Subject: [PATCH] Some bug fixes --- src/world/Territory/Territory.cpp | 1 + src/world/WorldServer.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/world/Territory/Territory.cpp b/src/world/Territory/Territory.cpp index de4a5c4f..1948a207 100644 --- a/src/world/Territory/Territory.cpp +++ b/src/world/Territory/Territory.cpp @@ -836,6 +836,7 @@ Entity::BNpcPtr Territory::createBNpcFromLayoutId( uint32_t layoutId, uint32_t h return nullptr; auto pBNpc = std::make_shared< Entity::BNpc >( getNextActorId(), infoPtr->second, *this, hp, bnpcType ); + pBNpc->init(); pBNpc->setTriggerOwnerId( triggerOwnerId ); pushActor( pBNpc ); return pBNpc; diff --git a/src/world/WorldServer.cpp b/src/world/WorldServer.cpp index 4748e1e9..8c888209 100644 --- a/src/world/WorldServer.cpp +++ b/src/world/WorldServer.cpp @@ -144,6 +144,11 @@ std::string readFileToString( const std::string& filename ) // Close the file file.close(); + // Remove all newlines from the file contents + fileContents.erase(std::remove(fileContents.begin(), fileContents.end(), '\n'), fileContents.end()); + fileContents.erase(std::remove(fileContents.begin(), fileContents.end(), '\r'), fileContents.end()); + + // Return the file contents as a string return fileContents; }