[Commands] Cleanup #makepet Command. (#2105)

- Cleanup messages and logic.
This commit is contained in:
Kinglykrab 2022-05-06 20:58:07 -04:00 committed by GitHub
parent a847e461c1
commit e62a283a79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View File

@ -232,7 +232,7 @@ int command_init(void)
command_add("loc", "- Print out your or your target's current location and heading", AccountStatus::Player, command_loc) ||
command_add("lock", "- Lock the worldserver", AccountStatus::GMLeadAdmin, command_lock) ||
command_add("logs", "Manage anything to do with logs", AccountStatus::GMImpossible, command_logs) ||
command_add("makepet", "[level] [class] [race] [texture] - Make a pet", AccountStatus::Guide, command_makepet) ||
command_add("makepet", "[Pet Name] - Make a pet", AccountStatus::Guide, command_makepet) ||
command_add("mana", "- Fill your or your target's mana", AccountStatus::Guide, command_mana) ||
command_add("maxskills", "Maxes skills for you.", AccountStatus::GMMgmt, command_max_all_skills) ||
command_add("memspell", "[Spell ID] [Spell Gem] - Memorize a Spell by ID to the specified Spell Gem for you or your target", AccountStatus::Guide, command_memspell) ||

View File

@ -2,11 +2,18 @@
void command_makepet(Client *c, const Seperator *sep)
{
if (sep->arg[1][0] == '\0') {
c->Message(Chat::White, "Usage: #makepet pet_type_name (will not survive across zones)");
int arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Usage: #makepet [Pet Name]");
return;
}
else {
c->MakePet(0, sep->arg[1]);
std::string pet_name = sep->arg[1];
if (pet_name.empty()) {
c->Message(Chat::White, "Usage: #makepet [Pet Name]");
return;
}
c->MakePet(0, pet_name.c_str());
}