Fix some minor typos

This commit is contained in:
Antz 2020-01-14 16:01:59 +00:00
parent 302f1c64fb
commit 7c63aee64a
22 changed files with 57 additions and 62 deletions

View File

@ -1,7 +1,7 @@
# MaNGOS is a full featured server for World of Warcraft, supporting # MaNGOS is a full featured server for World of Warcraft, supporting
# the following clients: 1.12.x, 2.4.3, 3.3.5a, 4.3.4a and 5.4.8 # the following clients: 1.12.x, 2.4.3, 3.3.5a, 4.3.4a and 5.4.8
# #
# Copyright (C) 2005-2020 MaNGOS project <https://getmangos.eu> # Copyright (C) 2005-2020 MaNGOS <https://getmangos.eu>
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@ -214,7 +214,9 @@ class GMTicketMgr
{ {
GMTicketIdMap::iterator itr = m_GMTicketIdMap.find(id); GMTicketIdMap::iterator itr = m_GMTicketIdMap.find(id);
if (itr == m_GMTicketIdMap.end()) if (itr == m_GMTicketIdMap.end())
{
return NULL; return NULL;
}
return itr->second; return itr->second;
} }

View File

@ -219,7 +219,9 @@ bool Totem::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex
// Mana Spring, Healing stream, Mana tide // Mana Spring, Healing stream, Mana tide
// Flags : 0x00000002000 | 0x00000004000 | 0x00004000000 -> 0x00004006000 // Flags : 0x00000002000 | 0x00000004000 | 0x00004000000 -> 0x00004006000
if (spellInfo->SpellFamilyName == SPELLFAMILY_SHAMAN && spellInfo->IsFitToFamilyMask(UI64LIT(0x00004006000))) if (spellInfo->SpellFamilyName == SPELLFAMILY_SHAMAN && spellInfo->IsFitToFamilyMask(UI64LIT(0x00004006000)))
{
return false; return false;
}
switch (spellInfo->Effect[index]) switch (spellInfo->Effect[index])
{ {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2015-2020 MaNGOS <http://getmangos.eu> * Copyright (C) 2015-2020 MaNGOS <https://getmangos.eu>
* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2015-2020 MaNGOS project <http://getmangos.eu> * Copyright (C) 2015-2020 MaNGOS project <https://getmangos.eu>
* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
* *

View File

@ -71,7 +71,9 @@ namespace VMAP
void ModelInstance::GetAreaInfo(const G3D::Vector3& p, AreaInfo& info) const void ModelInstance::GetAreaInfo(const G3D::Vector3& p, AreaInfo& info) const
{ {
if (!iModel) if (!iModel)
{
return; return;
}
// M2 files don't contain area info, only WMO files // M2 files don't contain area info, only WMO files
if (flags & MOD_M2) if (flags & MOD_M2)
@ -106,7 +108,9 @@ namespace VMAP
bool ModelInstance::GetLocationInfo(const G3D::Vector3& p, LocationInfo& info) const bool ModelInstance::GetLocationInfo(const G3D::Vector3& p, LocationInfo& info) const
{ {
if (!iModel) if (!iModel)
{
return false; return false;
}
// M2 files don't contain area info, only WMO files // M2 files don't contain area info, only WMO files
if (flags & MOD_M2) if (flags & MOD_M2)

View File

@ -152,7 +152,9 @@ namespace VMAP
bool VMapManager2::isInLineOfSight(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2) bool VMapManager2::isInLineOfSight(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2)
{ {
if (!isLineOfSightCalcEnabled() || IsVMAPDisabledForPtr(pMapId, VMAP_DISABLE_LOS)) if (!isLineOfSightCalcEnabled() || IsVMAPDisabledForPtr(pMapId, VMAP_DISABLE_LOS))
{
return true; return true;
}
bool result = true; bool result = true;
InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(pMapId); InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(pMapId);
@ -253,12 +255,16 @@ namespace VMAP
floor = info.ground_Z; floor = info.ground_Z;
type = info.hitModel->GetLiquidType(); type = info.hitModel->GetLiquidType();
if (ReqLiquidType && !(type & ReqLiquidType)) if (ReqLiquidType && !(type & ReqLiquidType))
{
return false; return false;
}
if (info.hitInstance->GetLiquidLevel(pos, info, level)) if (info.hitInstance->GetLiquidLevel(pos, info, level))
{
return true; return true;
} }
} }
} }
}
return false; return false;
} }

View File

@ -8,7 +8,9 @@ using namespace ai;
ObjectGuid Event::getObject() ObjectGuid Event::getObject()
{ {
if (packet.empty()) if (packet.empty())
{
return ObjectGuid(); return ObjectGuid();
}
WorldPacket p(packet); WorldPacket p(packet);
p.rpos(0); p.rpos(0);

View File

@ -15,7 +15,9 @@ bool ReachAreaTriggerAction::Execute(Event event)
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(triggerId); AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(triggerId);
if(!atEntry) if(!atEntry)
{
return false; return false;
}
AreaTrigger const* at = sObjectMgr.GetAreaTrigger(triggerId); AreaTrigger const* at = sObjectMgr.GetAreaTrigger(triggerId);
if (!at) if (!at)
@ -65,11 +67,15 @@ bool AreaTriggerAction::Execute(Event event)
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(triggerId); AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(triggerId);
if(!atEntry) if(!atEntry)
{
return false; return false;
}
AreaTrigger const* at = sObjectMgr.GetAreaTrigger(triggerId); AreaTrigger const* at = sObjectMgr.GetAreaTrigger(triggerId);
if (!at) if (!at)
{
return true; return true;
}
ai->ChangeStrategy("-follow,+stay", BOT_STATE_NON_COMBAT); ai->ChangeStrategy("-follow,+stay", BOT_STATE_NON_COMBAT);

View File

@ -12,7 +12,9 @@ bool CastSpellAction::Execute(Event event)
bool CastSpellAction::isPossible() bool CastSpellAction::isPossible()
{ {
if (AI_VALUE2(float, "distance", GetTargetName()) > range) if (AI_VALUE2(float, "distance", GetTargetName()) > range)
{
return false; return false;
}
return ai->CanCastSpell(spell, GetTarget()); return ai->CanCastSpell(spell, GetTarget());
} }
@ -30,7 +32,9 @@ bool CastAuraSpellAction::isUseful()
bool CastEnchantItemAction::isUseful() bool CastEnchantItemAction::isUseful()
{ {
if (!CastSpellAction::isUseful()) if (!CastSpellAction::isUseful())
{
return false; return false;
}
uint32 spellId = AI_VALUE2(uint32, "spell id", spell); uint32 spellId = AI_VALUE2(uint32, "spell id", spell);
return spellId && AI_VALUE2(Item*, "item for spell", spellId); return spellId && AI_VALUE2(Item*, "item for spell", spellId);

View File

@ -41,11 +41,19 @@ string LogLevelAction::logLevel2string(LogLevel level)
LogLevel LogLevelAction::string2logLevel(string level) LogLevel LogLevelAction::string2logLevel(string level)
{ {
if (level == "debug") if (level == "debug")
{
return LOG_LVL_DEBUG; return LOG_LVL_DEBUG;
}
else if (level == "minimal") else if (level == "minimal")
{
return LOG_LVL_MINIMAL; return LOG_LVL_MINIMAL;
}
else if (level == "detail") else if (level == "detail")
{
return LOG_LVL_DETAIL; return LOG_LVL_DETAIL;
}
else else
{
return LOG_LVL_BASIC; return LOG_LVL_BASIC;
}
} }

View File

@ -14,7 +14,9 @@ namespace ai
virtual bool Execute(Event event) virtual bool Execute(Event event)
{ {
if (bot->IsAlive() || bot->GetCorpse()) if (bot->IsAlive() || bot->GetCorpse())
{
return false; return false;
}
ai->ChangeStrategy("-follow,+stay", BOT_STATE_NON_COMBAT); ai->ChangeStrategy("-follow,+stay", BOT_STATE_NON_COMBAT);

View File

@ -14,15 +14,21 @@ namespace ai
LastMovement& movement = context->GetValue<LastMovement&>("last movement")->Get(); LastMovement& movement = context->GetValue<LastMovement&>("last movement")->Get();
if (!movement.lastAreaTrigger) if (!movement.lastAreaTrigger)
{
return false; return false;
}
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(movement.lastAreaTrigger); AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(movement.lastAreaTrigger);
if(!atEntry) if(!atEntry)
{
return false; return false;
}
AreaTrigger const* at = sObjectMgr.GetAreaTrigger(movement.lastAreaTrigger); AreaTrigger const* at = sObjectMgr.GetAreaTrigger(movement.lastAreaTrigger);
if (!at) if (!at)
{
return false; return false;
}
return IsPointInAreaTriggerZone(atEntry, bot->GetMapId(), bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), 0.5f); return IsPointInAreaTriggerZone(atEntry, bot->GetMapId(), bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), 0.5f);
} }

View File

@ -9,11 +9,15 @@ Unit* CurrentTargetValue::Get()
if (selection.IsEmpty()) if (selection.IsEmpty())
{
return NULL; return NULL;
}
Unit* unit = sObjectAccessor.GetUnit(*bot, selection); Unit* unit = sObjectAccessor.GetUnit(*bot, selection);
if (unit && !bot->IsWithinLOSInMap(unit)) if (unit && !bot->IsWithinLOSInMap(unit))
{
return NULL; return NULL;
}
return unit; return unit;
} }

View File

@ -12,7 +12,9 @@ namespace ai
{ {
Unit* target = AI_VALUE(Unit*, qualifier); Unit* target = AI_VALUE(Unit*, qualifier);
if (!target) if (!target)
{
return false; return false;
}
float targetOrientation = target->GetOrientation(); float targetOrientation = target->GetOrientation();

View File

@ -15,7 +15,9 @@ public:
{ {
Pet* pet = dynamic_cast<Pet*>(unit); Pet* pet = dynamic_cast<Pet*>(unit);
if (pet && (pet->getPetType() == MINI_PET || pet->getPetType() == SUMMON_PET)) if (pet && (pet->getPetType() == MINI_PET || pet->getPetType() == SUMMON_PET))
{
return false; return false;
}
return unit->IsAlive() && !ai->HasAura(aura, unit); return unit->IsAlive() && !ai->HasAura(aura, unit);
} }

View File

@ -9,15 +9,11 @@ bool SpellCastUsefulValue::Calculate()
{ {
uint32 spellid = AI_VALUE2(uint32, "spell id", qualifier); uint32 spellid = AI_VALUE2(uint32, "spell id", qualifier);
if (!spellid) if (!spellid)
{
return true; // there can be known alternatives return true; // there can be known alternatives
}
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellid); SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellid);
if (!spellInfo) if (!spellInfo)
{
return true; // there can be known alternatives return true; // there can be known alternatives
}
if (spellInfo->Attributes & SPELL_ATTR_ON_NEXT_SWING_1 || if (spellInfo->Attributes & SPELL_ATTR_ON_NEXT_SWING_1 ||
spellInfo->Attributes & SPELL_ATTR_ON_NEXT_SWING_2) spellInfo->Attributes & SPELL_ATTR_ON_NEXT_SWING_2)

@ -1 +1 @@
Subproject commit 385cc36e8c3014f7cb3a9b59d9fcd2152ed35bd0 Subproject commit 27c55d658c52d3d93c3165a9fb73838ca5fea6c1

@ -1 +1 @@
Subproject commit 96b47228fb4ba43c257be7a530c295fc9f64c2fe Subproject commit 53f9d558cd5c73d9808d60a72e4e215040c812cc

View File

@ -160,7 +160,9 @@ class Field
{ {
int64 value = 0; int64 value = 0;
if (!mValue || sscanf(mValue, SI64FMTD, &value) == -1) if (!mValue || sscanf(mValue, SI64FMTD, &value) == -1)
{
return 0; return 0;
}
return value; return value;
} }

View File

@ -453,57 +453,6 @@ bool WStrToUtf8(std::wstring wstr, std::string& utf8str)
typedef wchar_t const* const* wstrlist; typedef wchar_t const* const* wstrlist;
std::wstring GetMainPartOfName(std::wstring wname, uint32 declension)
{
// supported only Cyrillic cases
if (wname.size() < 1 || !isCyrillicCharacter(wname[0]) || declension > 5)
{
return wname;
}
// Important: end length must be <= MAX_INTERNAL_PLAYER_NAME-MAX_PLAYER_NAME (3 currently)
static wchar_t const a_End[] = { wchar_t(1), wchar_t(0x0430), wchar_t(0x0000)};
static wchar_t const o_End[] = { wchar_t(1), wchar_t(0x043E), wchar_t(0x0000)};
static wchar_t const ya_End[] = { wchar_t(1), wchar_t(0x044F), wchar_t(0x0000)};
static wchar_t const ie_End[] = { wchar_t(1), wchar_t(0x0435), wchar_t(0x0000)};
static wchar_t const i_End[] = { wchar_t(1), wchar_t(0x0438), wchar_t(0x0000)};
static wchar_t const yeru_End[] = { wchar_t(1), wchar_t(0x044B), wchar_t(0x0000)};
static wchar_t const u_End[] = { wchar_t(1), wchar_t(0x0443), wchar_t(0x0000)};
static wchar_t const yu_End[] = { wchar_t(1), wchar_t(0x044E), wchar_t(0x0000)};
static wchar_t const oj_End[] = { wchar_t(2), wchar_t(0x043E), wchar_t(0x0439), wchar_t(0x0000)};
static wchar_t const ie_j_End[] = { wchar_t(2), wchar_t(0x0435), wchar_t(0x0439), wchar_t(0x0000)};
static wchar_t const io_j_End[] = { wchar_t(2), wchar_t(0x0451), wchar_t(0x0439), wchar_t(0x0000)};
static wchar_t const o_m_End[] = { wchar_t(2), wchar_t(0x043E), wchar_t(0x043C), wchar_t(0x0000)};
static wchar_t const io_m_End[] = { wchar_t(2), wchar_t(0x0451), wchar_t(0x043C), wchar_t(0x0000)};
static wchar_t const ie_m_End[] = { wchar_t(2), wchar_t(0x0435), wchar_t(0x043C), wchar_t(0x0000)};
static wchar_t const soft_End[] = { wchar_t(1), wchar_t(0x044C), wchar_t(0x0000)};
static wchar_t const j_End[] = { wchar_t(1), wchar_t(0x0439), wchar_t(0x0000)};
static wchar_t const* const dropEnds[6][8] =
{
{ &a_End[1], &o_End[1], &ya_End[1], &ie_End[1], &soft_End[1], &j_End[1], NULL, NULL },
{ &a_End[1], &ya_End[1], &yeru_End[1], &i_End[1], NULL, NULL, NULL, NULL },
{ &ie_End[1], &u_End[1], &yu_End[1], &i_End[1], NULL, NULL, NULL, NULL },
{ &u_End[1], &yu_End[1], &o_End[1], &ie_End[1], &soft_End[1], &ya_End[1], &a_End[1], NULL },
{ &oj_End[1], &io_j_End[1], &ie_j_End[1], &o_m_End[1], &io_m_End[1], &ie_m_End[1], &yu_End[1], NULL },
{ &ie_End[1], &i_End[1], NULL, NULL, NULL, NULL, NULL, NULL }
};
for (wchar_t const * const* itr = &dropEnds[declension][0]; *itr; ++itr)
{
size_t len = size_t((*itr)[-1]); // get length from string size field
if (wname.substr(wname.size() - len, len) == *itr)
{
return wname.substr(0, wname.size() - len);
}
}
return wname;
}
bool utf8ToConsole(const std::string& utf8str, std::string& conStr) bool utf8ToConsole(const std::string& utf8str, std::string& conStr)
{ {
#if PLATFORM == PLATFORM_WINDOWS #if PLATFORM == PLATFORM_WINDOWS

View File

@ -746,8 +746,6 @@ inline void wstrToLower(std::wstring& str)
std::transform(str.begin(), str.end(), str.begin(), [](wchar_t w) {return wcharToLower(w); }); std::transform(str.begin(), str.end(), str.begin(), [](wchar_t w) {return wcharToLower(w); });
} }
std::wstring GetMainPartOfName(std::wstring wname, uint32 declension);
/** /**
* @brief * @brief
* *