mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-29 04:12:24 +00:00
[Crash] Fix command crash with #npcedit weapon when second weapon not passed ni (#2829)
This commit is contained in:
parent
d369b47ef4
commit
34d21d4056
@ -536,14 +536,14 @@ void command_npcedit(Client *c, const Seperator *sep)
|
|||||||
} else if (!strcasecmp(sep->arg[1], "weapon")) {
|
} else if (!strcasecmp(sep->arg[1], "weapon")) {
|
||||||
if (sep->IsNumber(2)) {
|
if (sep->IsNumber(2)) {
|
||||||
auto primary_model = std::stoul(sep->arg[2]);
|
auto primary_model = std::stoul(sep->arg[2]);
|
||||||
uint32_t secondary_model = sep->IsNumber(3) ? std::stoul(sep->arg[3]) : 0;
|
uint32_t secondary_model = sep->arg[3] && sep->IsNumber(3) ? std::stoul(sep->arg[3]) : 0;
|
||||||
n.d_melee_texture1 = primary_model;
|
n.d_melee_texture1 = primary_model;
|
||||||
n.d_melee_texture2 = secondary_model;
|
n.d_melee_texture2 = secondary_model;
|
||||||
d = fmt::format(
|
d = fmt::format(
|
||||||
"{} will have Model {} set to their Primary and Model {} set to their Secondary on repop.",
|
"{} will have Model {} set to their Primary and Model {} set to their Secondary on repop.",
|
||||||
npc_id_string,
|
npc_id_string,
|
||||||
Strings::Commify(sep->arg[2]),
|
Strings::Commify(sep->arg[2]),
|
||||||
sep->IsNumber(3) ? Strings::Commify(sep->arg[3]) : 0
|
sep->arg[3] && sep->IsNumber(3) ? Strings::Commify(sep->arg[3]) : 0
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
c->Message(
|
c->Message(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user