mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-05 19:46:35 +00:00
[Code Cleanup] Race constants refactor (#3782)
* [Code Cleanup] Race constants refactor * Update races.h
This commit is contained in:
@@ -5,7 +5,7 @@ void FindRace(Client *c, const Seperator *sep)
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto race_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[2]));
|
||||
const std::string& race_name = GetRaceIDName(race_id);
|
||||
if (EQ::ValueWithin(race_id, RACE_HUMAN_1, RACE_PEGASUS_732)) {
|
||||
if (EQ::ValueWithin(race_id, Race::Human, Race::Pegasus3)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
@@ -41,7 +41,7 @@ void FindRace(Client *c, const Seperator *sep)
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
for (uint16 race_id = RACE_HUMAN_1; race_id <= RACE_PEGASUS_732; race_id++) {
|
||||
for (uint16 race_id = Race::Human; race_id <= Race::Pegasus3; race_id++) {
|
||||
std::string race_name = GetRaceIDName(race_id);
|
||||
auto race_name_lower = Strings::ToLower(race_name);
|
||||
if (!Strings::Contains(race_name_lower, search_criteria)) {
|
||||
|
||||
@@ -23,7 +23,7 @@ void SetRace(Client *c, const Seperator *sep)
|
||||
const uint16 race_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
|
||||
if (
|
||||
!EQ::ValueWithin(race_id, RACE_DOUG_0, RuleI(NPC, MaxRaceID)) &&
|
||||
!EQ::ValueWithin(race_id, Race::Doug, RuleI(NPC, MaxRaceID)) &&
|
||||
!EQ::ValueWithin(race_id, 2253, 2259)
|
||||
) {
|
||||
c->Message(
|
||||
|
||||
@@ -4,7 +4,7 @@ void ShowZonePoints(Client *c, const Seperator *sep)
|
||||
{
|
||||
for (const auto& m : entity_list.GetMobList()) {
|
||||
Mob* mob = m.second;
|
||||
if (mob->IsNPC() && mob->GetRace() == RACE_NODE_2254) {
|
||||
if (mob->IsNPC() && mob->GetRace() == Race::Node) {
|
||||
mob->Depop();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user