mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
[Bug Fix] Fix Crash with null Argument in #modifynpcstat (#4318)
* [Bug Fix] Fix Crash with null Argument in #modifynpcstat * Update modifynpcstat.cpp * Update modifynpcstat.cpp
This commit is contained in:
parent
0d1cbecb55
commit
6bcd8fea18
@ -16,8 +16,14 @@ void command_modifynpcstat(Client *c, const Seperator *sep)
|
||||
|
||||
auto target = c->GetTarget()->CastToNPC();
|
||||
|
||||
std::string stat = sep->arg[1];
|
||||
std::string value = sep->arg[2] ? sep->arg[2] : "";
|
||||
const std::string& stat = sep->arg[1] ? sep->arg[1] : "";
|
||||
const std::string& value = sep->arg[2] ? sep->arg[2] : "";
|
||||
|
||||
if (stat.empty() || value.empty()) {
|
||||
c->Message(Chat::White, "Usage: #modifynpcstat [Stat] [Value]");
|
||||
ListModifyNPCStatMap(c);
|
||||
return;
|
||||
}
|
||||
|
||||
auto stat_description = GetModifyNPCStatDescription(stat);
|
||||
if (!stat_description.length()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user