mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-19 16:58:20 +00:00
code cleanup 3
This commit is contained in:
@@ -89,13 +89,13 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep)
|
||||
std::string arg2 = sep->arg[2];
|
||||
int ab_arg = 2;
|
||||
bool current_check = false;
|
||||
uint16 spellType = 0;
|
||||
uint32 typeValue = 0;
|
||||
uint16 spell_type = 0;
|
||||
uint32 type_value = 0;
|
||||
|
||||
if (sep->IsNumber(1)) {
|
||||
spellType = atoi(sep->arg[1]);
|
||||
spell_type = atoi(sep->arg[1]);
|
||||
|
||||
if (!IsClientBotSpellType(spellType)) {
|
||||
if (!IsClientBotSpellType(spell_type)) {
|
||||
c->Message(Chat::Yellow, "Invalid spell type.");
|
||||
c->SendSpellTypePrompts(false, true);
|
||||
|
||||
@@ -104,9 +104,9 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep)
|
||||
}
|
||||
else {
|
||||
if (c->GetSpellTypeIDByShortName(arg1) != UINT16_MAX) {
|
||||
spellType = c->GetSpellTypeIDByShortName(arg1);
|
||||
spell_type = c->GetSpellTypeIDByShortName(arg1);
|
||||
|
||||
if (!IsClientBotSpellType(spellType)) {
|
||||
if (!IsClientBotSpellType(spell_type)) {
|
||||
c->Message(Chat::Yellow, "Invalid spell type.");
|
||||
c->SendSpellTypePrompts(false, true);
|
||||
}
|
||||
@@ -128,9 +128,9 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep)
|
||||
|
||||
// Enable/Disable/Current checks
|
||||
if (sep->IsNumber(2)) {
|
||||
typeValue = atoi(sep->arg[2]);
|
||||
type_value = atoi(sep->arg[2]);
|
||||
++ab_arg;
|
||||
if (typeValue < 0 || typeValue > 100) {
|
||||
if (type_value < 0 || type_value > 100) {
|
||||
c->Message(Chat::Yellow, "You must enter a value between 0-100 (0%% to 100%% of your health).");
|
||||
|
||||
return;
|
||||
@@ -159,19 +159,19 @@ void command_spell_min_thresholds(Client* c, const Seperator* sep)
|
||||
Chat::Green,
|
||||
fmt::format(
|
||||
"Your [{}] minimum hold is currently [{}%%].'",
|
||||
c->GetSpellTypeNameByID(spellType),
|
||||
c->GetSpellMinThreshold(spellType)
|
||||
c->GetSpellTypeNameByID(spell_type),
|
||||
c->GetSpellMinThreshold(spell_type)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
c->SetSpellMinThreshold(spellType, typeValue);
|
||||
c->SetSpellMinThreshold(spell_type, type_value);
|
||||
c->Message(
|
||||
Chat::Green,
|
||||
fmt::format(
|
||||
"Your [{}] minimum hold was set to [{}%%].'",
|
||||
c->GetSpellTypeNameByID(spellType),
|
||||
c->GetSpellMinThreshold(spellType)
|
||||
c->GetSpellTypeNameByID(spell_type),
|
||||
c->GetSpellMinThreshold(spell_type)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user