[Code Cleanup] Remove this-> in code where its implied (#2088)

This commit is contained in:
Chris Miles
2022-05-01 09:22:09 -05:00
committed by GitHub
parent b02008ec53
commit 5b4aeaa457
47 changed files with 1033 additions and 1033 deletions
+29 -29
View File
@@ -91,7 +91,7 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
Merc::~Merc() {
AI_Stop();
//entity_list.RemoveMerc(this->GetID());
//entity_list.RemoveMerc(GetID());
UninitializeBuffSlots();
}
@@ -132,7 +132,7 @@ float Merc::GetDefaultSize() {
float MercSize = GetSize();
switch(this->GetRace())
switch(GetRace())
{
case 1: // Humans
MercSize = 6.0;
@@ -946,7 +946,7 @@ int32 Merc::CalcManaRegen()
{
BuffFadeBySitModifier();
if (HasSkill(EQ::skills::SkillMeditate)) {
this->_medding = true;
_medding = true;
regen = ((GetSkill(EQ::skills::SkillMeditate) / 10) + mana_regen);
regen += spellbonuses.ManaRegen + itembonuses.ManaRegen;
}
@@ -954,7 +954,7 @@ int32 Merc::CalcManaRegen()
regen = mana_regen + spellbonuses.ManaRegen + itembonuses.ManaRegen;
}
else {
this->_medding = false;
_medding = false;
regen = mana_regen + spellbonuses.ManaRegen + itembonuses.ManaRegen;
}
@@ -1636,13 +1636,13 @@ void Merc::AI_Process() {
// TODO: Do mercs berserk? Find this out on live...
//if (GetClass() == WARRIOR || GetClass() == BERSERKER) {
// if(GetHP() > 0 && !berserk && this->GetHPRatio() < 30) {
// if(GetHP() > 0 && !berserk && GetHPRatio() < 30) {
// entity_list.MessageCloseString(this, false, 200, 0, BERSERK_START, GetName());
// this->berserk = true;
// berserk = true;
// }
// if (berserk && this->GetHPRatio() > 30) {
// if (berserk && GetHPRatio() > 30) {
// entity_list.MessageCloseString(this, false, 200, 0, BERSERK_END, GetName());
// this->berserk = false;
// berserk = false;
// }
//}
@@ -1862,7 +1862,7 @@ bool Merc::AI_IdleCastCheck() {
if (AIautocastspell_timer->Check(false)) {
#if MercAI_DEBUG_Spells >= 25
LogAI("Merc Non-Engaged autocast check triggered: [{}]", this->GetCleanName());
LogAI("Merc Non-Engaged autocast check triggered: [{}]", GetCleanName());
#endif
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.
@@ -2184,14 +2184,14 @@ bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) {
}
if(spells[selectedMercSpell.spellid].target_type == ST_Self) {
if( !this->IsImmuneToSpell(selectedMercSpell.spellid, this)
&& (this->CanBuffStack(selectedMercSpell.spellid, mercLevel, true) >= 0)) {
if( !IsImmuneToSpell(selectedMercSpell.spellid, this)
&& (CanBuffStack(selectedMercSpell.spellid, mercLevel, true) >= 0)) {
if( this->GetArchetype() == ARCHETYPE_MELEE && IsEffectInSpell(selectedMercSpell.spellid, SE_IncreaseSpellHaste)) {
if( GetArchetype() == ARCHETYPE_MELEE && IsEffectInSpell(selectedMercSpell.spellid, SE_IncreaseSpellHaste)) {
continue;
}
uint32 TempDontBuffMeBeforeTime = this->DontBuffMeBefore();
uint32 TempDontBuffMeBeforeTime = DontBuffMeBefore();
if(selectedMercSpell.spellid > 0) {
if(isDiscipline) {
@@ -2200,8 +2200,8 @@ bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) {
else {
castedSpell = AIDoSpellCast(selectedMercSpell.spellid, this, -1, &TempDontBuffMeBeforeTime);
if(TempDontBuffMeBeforeTime != this->DontBuffMeBefore())
this->SetDontBuffMeBefore(TempDontBuffMeBeforeTime);
if(TempDontBuffMeBeforeTime != DontBuffMeBefore())
SetDontBuffMeBefore(TempDontBuffMeBeforeTime);
}
}
}
@@ -2388,8 +2388,8 @@ bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) {
if(castedSpell) {
if(IsGroupSpell(selectedMercSpell.spellid)){
if(this->HasGroup()) {
Group *g = this->GetGroup();
if(HasGroup()) {
Group *g = GetGroup();
if(g) {
for( int i = 0; i<MAX_GROUP_MEMBERS; i++) {
@@ -2682,8 +2682,8 @@ int32 Merc::GetFocusEffect(focusType type, uint16 spell_id, bool from_buff_tic)
for (int i = 0; i < MAX_PP_AA_ARRAY; i++)
{
aa_AA = this->aa[i]->AA;
aa_value = this->aa[i]->value;
aa_AA = aa[i]->AA;
aa_value = aa[i]->value;
if (aa_AA < 1 || aa_value < 1)
continue;
@@ -2711,9 +2711,9 @@ int32 Merc::GetFocusEffect(focusType type, uint16 spell_id, bool from_buff_tic)
int32 Merc::GetActSpellCost(uint16 spell_id, int32 cost)
{
// Formula = Unknown exact, based off a random percent chance up to mana cost(after focuses) of the cast spell
if(this->itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%17) - 1] >= GetLevel() - 5)
if(itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%17) - 1] >= GetLevel() - 5)
{
int16 mana_back = this->itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100;
int16 mana_back = itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100;
// Doesnt generate mana, so best case is a free spell
if(mana_back > cost)
mana_back = cost;
@@ -4240,7 +4240,7 @@ bool Merc::CheckConfidence() {
if(DistanceSquared(m_Position, mob->GetPosition()) > AggroRange) continue;
CurrentCon = this->GetLevelCon(mob->GetLevel());
CurrentCon = GetLevelCon(mob->GetLevel());
switch(CurrentCon) {
@@ -4513,7 +4513,7 @@ void Merc::SetTarget(Mob* mob) {
Mob* Merc::GetOwnerOrSelf() {
Mob* Result = nullptr;
if(this->GetMercOwner())
if(GetMercOwner())
Result = GetMercOwner();
else
Result = this;
@@ -4565,7 +4565,7 @@ Mob* Merc::GetOwner() {
Result = entity_list.GetMob(GetOwnerID());
if(!Result) {
this->SetOwnerID(0);
SetOwnerID(0);
}
return Result->CastToMob();
@@ -5052,7 +5052,7 @@ void Merc::UpdateMercAppearance() {
if(itemID != 0) {
materialFromSlot = EQ::InventoryProfile::CalcMaterialFromSlot(i);
if (materialFromSlot != EQ::textures::materialInvalid)
this->SendWearChange(materialFromSlot);
SendWearChange(materialFromSlot);
}
}
@@ -5790,7 +5790,7 @@ void Merc::Depop() {
RemoveMercFromGroup(this, GetGroup());
}
entity_list.RemoveMerc(this->GetID());
entity_list.RemoveMerc(GetID());
if(HasPet())
{
@@ -6064,9 +6064,9 @@ void Client::SetMerc(Merc* newmerc) {
{
SetMercID(newmerc->GetID());
//Client* oldowner = entity_list.GetClientByID(newmerc->GetOwnerID());
newmerc->SetOwnerID(this->GetID());
newmerc->SetMercCharacterID(this->CharacterID());
newmerc->SetClientVersion((uint8)this->ClientVersion());
newmerc->SetOwnerID(GetID());
newmerc->SetMercCharacterID(CharacterID());
newmerc->SetClientVersion((uint8)ClientVersion());
GetMercInfo().mercid = newmerc->GetMercID();
GetMercInfo().MercTemplateID = newmerc->GetMercTemplateID();
GetMercInfo().myTemplate = zone->GetMercTemplate(GetMercInfo().MercTemplateID);