diff options
author | Shauren <shauren.trinity@gmail.com> | 2022-06-09 23:04:32 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-06-09 23:04:32 +0200 |
commit | a89fe30b41f8a1b556d3a9ee9da41e32189f056f (patch) | |
tree | c6a11e337901cd4ba79c39d45e64d50ce6746936 | |
parent | 6ca0f99ccfc6549f3390a1bac151f85fdcb77561 (diff) |
Core/Commands: Fixed bonusListID and context arguments for .additem set command
-rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 367b42e9ec1..cf9d34bfa1c 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1492,7 +1492,7 @@ public: return true; } - static bool HandleAddItemSetCommand(ChatHandler* handler, Variant<Hyperlink<itemset>, uint32> itemSetId) + static bool HandleAddItemSetCommand(ChatHandler* handler, Variant<Hyperlink<itemset>, uint32> itemSetId, Optional<std::string_view> bonuses, Optional<uint8> context) { // prevent generation all items with itemset field value '0' if (*itemSetId == 0) @@ -1503,19 +1503,16 @@ public: } std::vector<int32> bonusListIDs; - char const* bonuses = strtok(nullptr, " "); - - char const* context = strtok(nullptr, " "); // semicolon separated bonuslist ids (parse them after all arguments are extracted by strtok!) if (bonuses) - for (std::string_view token : Trinity::Tokenize(bonuses, ';', false)) + for (std::string_view token : Trinity::Tokenize(*bonuses, ';', false)) if (Optional<int32> bonusListId = Trinity::StringTo<int32>(token)) bonusListIDs.push_back(*bonusListId); ItemContext itemContext = ItemContext::NONE; if (context) - itemContext = ItemContext(atoul(context)); + itemContext = ItemContext(*context); Player* player = handler->GetSession()->GetPlayer(); Player* playerTarget = handler->getSelectedPlayer(); |