diff options
| author | ccrs <ccrs@users.noreply.github.com> | 2019-07-01 21:36:32 +0200 |
|---|---|---|
| committer | ccrs <ccrs@users.noreply.github.com> | 2019-07-01 21:36:32 +0200 |
| commit | 401777d024785c58f90947cfdadd9b1b7d8fbd3b (patch) | |
| tree | 6a04418719d5fdaa519258a601a91ce073d1444b /src/server/scripts/Commands | |
| parent | e9004f9c905247f2240c3ca6e168bf9b858bf380 (diff) | |
Core/Unit: rename several getters to follow codestyle
uint8 GetLevel()
uint8 GetLevelForTarget(WorldObject const* /*target*/)
void SetLevel(uint8 lvl)
uint8 GetRace()
uint32 GetRaceMask()
uint8 GetClass()
uint32 GetClassMask()
uint8 GetGender()
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_character.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_learn.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_modify.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_npc.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_pet.cpp | 14 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_reset.cpp | 10 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_titles.cpp | 6 |
8 files changed, 30 insertions, 30 deletions
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index e52555ea634..02fe8b3e549 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -281,7 +281,7 @@ public: if (titleInfo && target->HasTitle(titleInfo)) { - std::string name = target->getGender() == GENDER_MALE ? titleInfo->nameMale[loc] : titleInfo->nameFemale[loc]; + std::string name = target->GetGender() == GENDER_MALE ? titleInfo->nameMale[loc] : titleInfo->nameFemale[loc]; if (name.empty()) continue; @@ -453,7 +453,7 @@ public: if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName)) return false; - int32 oldlevel = target ? target->getLevel() : sCharacterCache->GetCharacterLevelByGuid(targetGuid); + int32 oldlevel = target ? target->GetLevel() : sCharacterCache->GetCharacterLevelByGuid(targetGuid); int32 newlevel = levelStr ? atoi(levelStr) : oldlevel; if (newlevel < 1) @@ -907,7 +907,7 @@ public: if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName)) return false; - int32 oldlevel = target ? target->getLevel() : sCharacterCache->GetCharacterLevelByGuid(targetGuid); + int32 oldlevel = target ? target->GetLevel() : sCharacterCache->GetCharacterLevelByGuid(targetGuid); int32 addlevel = levelStr ? atoi(levelStr) : 1; int32 newlevel = oldlevel + addlevel; diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index ed0015f6a12..c76c9396cf7 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -148,7 +148,7 @@ public: static bool HandleLearnAllMySpellsCommand(ChatHandler* handler, char const* /*args*/) { - ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(handler->GetSession()->GetPlayer()->getClass()); + ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(handler->GetSession()->GetPlayer()->GetClass()); if (!classEntry) return true; uint32 family = classEntry->spellfamily; @@ -193,7 +193,7 @@ public: static bool HandleLearnAllMyTalentsCommand(ChatHandler* handler, char const* /*args*/) { Player* player = handler->GetSession()->GetPlayer(); - uint32 classMask = player->getClassMask(); + uint32 classMask = player->GetClassMask(); for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i) { @@ -441,7 +441,7 @@ public: static void HandleLearnSkillRecipesHelper(Player* player, uint32 skillId) { - uint32 classmask = player->getClassMask(); + uint32 classmask = player->GetClassMask(); for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) { diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index b595fb9e3cb..a6083fd53e6 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1623,15 +1623,15 @@ public: accId = target->GetSession()->GetAccountId(); money = target->GetMoney(); totalPlayerTime = target->GetTotalPlayedTime(); - level = target->getLevel(); + level = target->GetLevel(); latency = target->GetSession()->GetLatency(); - raceid = target->getRace(); - classid = target->getClass(); + raceid = target->GetRace(); + classid = target->GetClass(); muteTime = target->GetSession()->m_muteTime; mapId = target->GetMapId(); areaId = target->GetAreaId(); alive = target->IsAlive() ? handler->GetTrinityString(LANG_YES) : handler->GetTrinityString(LANG_NO); - gender = target->getGender(); + gender = target->GetGender(); phase = target->GetPhaseMask(); } // get additional information from DB diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 8a669557f83..0fa11461509 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -889,7 +889,7 @@ public: return false; } - PlayerInfo const* info = sObjectMgr->GetPlayerInfo(target->getRace(), target->getClass()); + PlayerInfo const* info = sObjectMgr->GetPlayerInfo(target->GetRace(), target->GetClass()); if (!info) return false; @@ -900,14 +900,14 @@ public: if (!strncmp(gender_str, "male", gender_len)) // MALE { - if (target->getGender() == GENDER_MALE) + if (target->GetGender() == GENDER_MALE) return true; gender = GENDER_MALE; } else if (!strncmp(gender_str, "female", gender_len)) // FEMALE { - if (target->getGender() == GENDER_FEMALE) + if (target->GetGender() == GENDER_FEMALE) return true; gender = GENDER_FEMALE; diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 243aa3cb104..18d937b1e06 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -656,7 +656,7 @@ public: handler->PSendSysMessage(LANG_SPAWNINFO_GROUP_ID, groupData->name.c_str(), groupData->groupId, groupData->flags, target->GetMap()->IsSpawnGroupActive(groupData->groupId)); } handler->PSendSysMessage(LANG_SPAWNINFO_COMPATIBILITY_MODE, target->GetRespawnCompatibilityMode()); - handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->getLevel()); + handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->GetLevel()); handler->PSendSysMessage(LANG_NPCINFO_EQUIPMENT, target->GetCurrentEquipmentId(), target->GetOriginalEquipmentId()); handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth()); handler->PSendSysMessage(LANG_NPCINFO_MOVEMENT_DATA, target->GetMovementTemplate().ToString().c_str()); @@ -1343,7 +1343,7 @@ public: pet->SetReactState(REACT_DEFENSIVE); // calculate proper level - uint8 level = std::max<uint8>(player->getLevel()-5, creatureTarget->getLevel()); + uint8 level = std::max<uint8>(player->GetLevel()-5, creatureTarget->GetLevel()); // prepare visual effect for levelup pet->SetUInt32Value(UNIT_FIELD_LEVEL, level - 1); diff --git a/src/server/scripts/Commands/cs_pet.cpp b/src/server/scripts/Commands/cs_pet.cpp index afe1f86d780..25290cfcdde 100644 --- a/src/server/scripts/Commands/cs_pet.cpp +++ b/src/server/scripts/Commands/cs_pet.cpp @@ -105,7 +105,7 @@ public: pet->SetGuidValue(UNIT_FIELD_CREATEDBY, player->GetGUID()); pet->SetFaction(player->GetFaction()); - if (!pet->InitStatsForLevel(creatureTarget->getLevel())) + if (!pet->InitStatsForLevel(creatureTarget->GetLevel())) { TC_LOG_ERROR("misc", "InitStatsForLevel() in EffectTameCreature failed! Pet deleted."); handler->PSendSysMessage("Error 2"); @@ -114,7 +114,7 @@ public: } // prepare visual effect for levelup - pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1); + pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->GetLevel()-1); pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true); // this enables pet details window (Shift+P) @@ -124,7 +124,7 @@ public: pet->GetMap()->AddToMap(pet->ToCreature()); // visual effect for levelup - pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()); + pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->GetLevel()); player->SetMinion(pet, true); pet->SavePetToDB(PET_SAVE_AS_CURRENT); @@ -211,7 +211,7 @@ public: int32 level = args ? atoi(args) : 0; if (level == 0) - level = owner->getLevel() - pet->getLevel(); + level = owner->GetLevel() - pet->GetLevel(); if (level == 0 || level < -STRONG_MAX_LEVEL || level > STRONG_MAX_LEVEL) { handler->SendSysMessage(LANG_BAD_VALUE); @@ -219,11 +219,11 @@ public: return false; } - int32 newLevel = pet->getLevel() + level; + int32 newLevel = pet->GetLevel() + level; if (newLevel < 1) newLevel = 1; - else if (newLevel > owner->getLevel()) - newLevel = owner->getLevel(); + else if (newLevel > owner->GetLevel()) + newLevel = owner->GetLevel(); pet->GivePetLevel(newLevel); return true; diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index ea643e57f2f..8f9e4784977 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -94,10 +94,10 @@ public: static bool HandleResetStatsOrLevelHelper(Player* player) { - ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(player->getClass()); + ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(player->GetClass()); if (!classEntry) { - TC_LOG_ERROR("misc", "Class %u not found in DBC (Wrong DBC files?)", player->getClass()); + TC_LOG_ERROR("misc", "Class %u not found in DBC (Wrong DBC files?)", player->GetClass()); return false; } @@ -107,7 +107,7 @@ public: if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT)) player->SetShapeshiftForm(FORM_NONE); - player->setFactionForRace(player->getRace()); + player->setFactionForRace(player->GetRace()); player->SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_POWER_TYPE, powerType); @@ -133,10 +133,10 @@ public: if (!HandleResetStatsOrLevelHelper(target)) return false; - uint8 oldLevel = target->getLevel(); + uint8 oldLevel = target->GetLevel(); // set starting level - uint32 startLevel = target->getClass() != CLASS_DEATH_KNIGHT + uint32 startLevel = target->GetClass() != CLASS_DEATH_KNIGHT ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL) : sWorld->getIntConfig(CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL); diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp index 21f3dae4966..7a389b66f36 100644 --- a/src/server/scripts/Commands/cs_titles.cpp +++ b/src/server/scripts/Commands/cs_titles.cpp @@ -94,7 +94,7 @@ public: target->SetTitle(titleInfo); // to be sure that title now known target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->bit_index); - handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, target->getGender() == GENDER_MALE ? titleInfo->nameMale[handler->GetSessionDbcLocale()] : titleInfo->nameFemale[handler->GetSessionDbcLocale()], tNameLink.c_str()); + handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, target->GetGender() == GENDER_MALE ? titleInfo->nameMale[handler->GetSessionDbcLocale()] : titleInfo->nameFemale[handler->GetSessionDbcLocale()], tNameLink.c_str()); return true; } @@ -137,7 +137,7 @@ public: std::string tNameLink = handler->GetNameLink(target); char titleNameStr[80]; - snprintf(titleNameStr, 80, target->getGender() == GENDER_MALE ? titleInfo->nameMale[handler->GetSessionDbcLocale()] : titleInfo->nameFemale[handler->GetSessionDbcLocale()], target->GetName().c_str()); + snprintf(titleNameStr, 80, target->GetGender() == GENDER_MALE ? titleInfo->nameMale[handler->GetSessionDbcLocale()] : titleInfo->nameFemale[handler->GetSessionDbcLocale()], target->GetName().c_str()); target->SetTitle(titleInfo); handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr, tNameLink.c_str()); @@ -185,7 +185,7 @@ public: std::string tNameLink = handler->GetNameLink(target); char titleNameStr[80]; - snprintf(titleNameStr, 80, target->getGender() == GENDER_MALE ? titleInfo->nameMale[handler->GetSessionDbcLocale()] : titleInfo->nameFemale[handler->GetSessionDbcLocale()], target->GetName().c_str()); + snprintf(titleNameStr, 80, target->GetGender() == GENDER_MALE ? titleInfo->nameMale[handler->GetSessionDbcLocale()] : titleInfo->nameFemale[handler->GetSessionDbcLocale()], target->GetName().c_str()); handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, id, titleNameStr, tNameLink.c_str()); |
