mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Bug Fix] Fix possible crash in #givemoney. (#1828)
This commit is contained in:
@@ -14,10 +14,10 @@ void command_givemoney(Client *c, const Seperator *sep)
|
||||
target = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
uint32 platinum = std::stoi(sep->arg[1]);
|
||||
uint32 gold = std::stoi(sep->arg[2]);
|
||||
uint32 silver = std::stoi(sep->arg[3]);
|
||||
uint32 copper = std::stoi(sep->arg[4]);
|
||||
uint32 platinum = std::stoul(sep->arg[1]);
|
||||
uint32 gold = sep->IsNumber(2) ? std::stoul(sep->arg[2]) : 0;
|
||||
uint32 silver = sep->IsNumber(3) ? std::stoul(sep->arg[3]) : 0;
|
||||
uint32 copper = sep->IsNumber(4) ? std::stoul(sep->arg[4]) : 0;
|
||||
if (!platinum && !gold && !silver && !copper) {
|
||||
c->Message(Chat::Red, "Usage: #Usage: #givemoney [Platinum] [Gold] [Silver] [Copper]");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user