mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 02:31:03 +00:00
[Feature] Add Strings::BeginsWith() and Strings::EndsWith() (#3471)
* [Strings] Add Strings::BeginsWith() and Strings::EndsWith() # Notes - These are useful so that we don't have to manually calculate size or perform a substring. * Update questmgr.cpp * Update client.cpp
This commit is contained in:
+4
-4
@@ -622,8 +622,8 @@ bool Client::TrainDiscipline(uint32 itemid) {
|
||||
const std::string item_name = item->Name;
|
||||
|
||||
if (
|
||||
item_name.substr(0, 5) != std::string("Tome ") &&
|
||||
item_name.substr(0, 7) != std::string("Skill: ")
|
||||
!Strings::BeginsWith(item_name, "Tome of ") &&
|
||||
!Strings::BeginsWith(item_name, "Skill: ")
|
||||
) {
|
||||
Message(Chat::Red, "This item is not a tome.");
|
||||
//summon them the item back...
|
||||
@@ -709,8 +709,8 @@ bool Client::MemorizeSpellFromItem(uint32 item_id) {
|
||||
const std::string item_name = item->Name;
|
||||
|
||||
if (
|
||||
item_name.substr(0, 7) != std::string("Spell: ") &&
|
||||
item_name.substr(0, 6) != std::string("Song: ")
|
||||
!Strings::BeginsWith(item_name, "Spell: ") &&
|
||||
!Strings::BeginsWith(item_name, "Song: ")
|
||||
) {
|
||||
Message(Chat::Red, "This item is not a scroll.");
|
||||
SummonItem(item_id);
|
||||
|
||||
Reference in New Issue
Block a user