Core: Minor code style corrections

This commit is contained in:
Shauren
2012-06-30 16:07:09 +02:00
parent 469c7a0955
commit c8d20004a5
19 changed files with 55 additions and 49 deletions
@@ -176,7 +176,7 @@ bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool Sto
Ray modRay(p, iInvRot * ray.direction());
float distance = MaxDist * iInvScale;
bool hit = iModel->IntersectRay(modRay, distance, StopAtFirstHit);
if(hit)
if (hit)
{
distance *= iScale;
MaxDist = distance;
+1 -1
View File
@@ -176,7 +176,7 @@ public:
}
if (cell == last_cell)
break;
if(tMaxX < tMaxY)
if (tMaxX < tMaxY)
{
tMaxX += tDeltaX;
cell.x += stepX;
+1 -1
View File
@@ -441,7 +441,7 @@ uint32 Condition::GetSearcherTypeMaskForCondition()
uint32 Condition::GetMaxAvailableConditionTargets()
{
// returns number of targets which are available for given source type
switch(SourceType)
switch (SourceType)
{
case CONDITION_SOURCE_TYPE_SPELL:
case CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET:
@@ -161,7 +161,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
etime *= MINUTE;
switch(etime)
switch (etime)
{
case 1*MIN_AUCTION_TIME:
case 2*MIN_AUCTION_TIME:
@@ -49,7 +49,7 @@ namespace Movement
data << move_spline.spline.getPoint(move_spline.spline.first());
data << move_spline.GetId();
switch(splineflags & MoveSplineFlag::Mask_Final_Facing)
switch (splineflags & MoveSplineFlag::Mask_Final_Facing)
{
case MoveSplineFlag::Final_Target:
data << uint8(MonsterMoveFacingTarget);
@@ -5083,7 +5083,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
break;
case SPELLFAMILY_ROGUE:
// Tricks of the trade
switch(GetId())
switch (GetId())
{
case 59628: //Tricks of the trade buff on rogue (6sec duration)
target->SetReducedThreatPercent(0,0);
+8 -8
View File
@@ -827,7 +827,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar
break;
}
switch(targetType.GetSelectionCategory())
switch (targetType.GetSelectionCategory())
{
case TARGET_SELECT_CATEGORY_CHANNEL:
SelectImplicitChannelTargets(effIndex, targetType);
@@ -845,7 +845,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar
switch (targetType.GetObjectType())
{
case TARGET_OBJECT_TYPE_SRC:
switch(targetType.GetReferenceType())
switch (targetType.GetReferenceType())
{
case TARGET_REFERENCE_TYPE_CASTER:
m_targets.SetSrc(*m_caster);
@@ -856,7 +856,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar
}
break;
case TARGET_OBJECT_TYPE_DEST:
switch(targetType.GetReferenceType())
switch (targetType.GetReferenceType())
{
case TARGET_REFERENCE_TYPE_CASTER:
SelectImplicitCasterDestTargets(effIndex, targetType);
@@ -873,7 +873,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar
}
break;
default:
switch(targetType.GetReferenceType())
switch (targetType.GetReferenceType())
{
case TARGET_REFERENCE_TYPE_CASTER:
SelectImplicitCasterObjectTargets(effIndex, targetType);
@@ -1367,7 +1367,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType)
{
switch(targetType.GetTarget())
switch (targetType.GetTarget())
{
case TARGET_DEST_CASTER:
m_targets.SetDst(*m_caster);
@@ -1432,7 +1432,7 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
void Spell::SelectImplicitTargetDestTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType)
{
WorldObject* target = m_targets.GetObjectTarget();
switch(targetType.GetTarget())
switch (targetType.GetTarget())
{
case TARGET_DEST_TARGET_ENEMY:
case TARGET_DEST_TARGET_ANY:
@@ -1465,7 +1465,7 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT
if (!m_targets.HasDst())
m_targets.SetDst(*m_caster);
switch(targetType.GetTarget())
switch (targetType.GetTarget())
{
case TARGET_DEST_DYNOBJ_ENEMY:
case TARGET_DEST_DYNOBJ_ALLY:
@@ -1491,7 +1491,7 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT
void Spell::SelectImplicitCasterObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType)
{
switch(targetType.GetTarget())
switch (targetType.GetTarget())
{
case TARGET_UNIT_CASTER:
AddUnitTarget(m_caster, 1 << effIndex, false);
+4 -4
View File
@@ -224,8 +224,8 @@ bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellEntry, uint8 eff
spellEntry->Effects[effIndex].TargetB.GetTarget() != targetType)
return false;
SpellImplicitTargetInfo targetType(this->targetType);
switch (targetType.GetSelectionCategory())
SpellImplicitTargetInfo targetInfo(targetType);
switch (targetInfo.GetSelectionCategory())
{
case TARGET_SELECT_CATEGORY_CHANNEL: // SINGLE
return !area;
@@ -235,13 +235,13 @@ bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellEntry, uint8 eff
case TARGET_SELECT_CATEGORY_AREA: // AREA
return area;
case TARGET_SELECT_CATEGORY_DEFAULT:
switch (targetType.GetObjectType())
switch (targetInfo.GetObjectType())
{
case TARGET_OBJECT_TYPE_SRC: // EMPTY
case TARGET_OBJECT_TYPE_DEST: // EMPTY
return false;
default:
switch(targetType.GetReferenceType())
switch (targetInfo.GetReferenceType())
{
case TARGET_REFERENCE_TYPE_CASTER: // SINGLE
return !area;
+1 -1
View File
@@ -211,7 +211,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData)
sLog->outDebug(LOG_FILTER_WARDEN, "Got packet, opcode %02X, size %u", opcode, uint32(recvData.size()));
recvData.hexlike();
switch(opcode)
switch (opcode)
{
case WARDEN_CMSG_MODULE_MISSING:
_warden->SendModuleToClient();
+1 -1
View File
@@ -121,7 +121,7 @@ void WardenCheckMgr::LoadWardenChecks()
if (checkType == MPQ_CHECK || checkType == MEM_CHECK)
{
WardenCheckResult *wr = new WardenCheckResult();
WardenCheckResult* wr = new WardenCheckResult();
wr->Result.SetHexStr(checkResult.c_str());
int len = checkResult.size() / 2;
if (wr->Result.GetNumBytes() < len)
+2 -2
View File
@@ -43,8 +43,8 @@ void WardenMac::Init(WorldSession *pClient, BigNumber *K)
_session = pClient;
// Generate Warden Key
SHA1Randx WK(K->AsByteArray(), K->GetNumBytes());
WK.generate(_inputKey, 16);
WK.generate(_outputKey, 16);
WK.Generate(_inputKey, 16);
WK.Generate(_outputKey, 16);
/*
Seed: 4D808D2C77D905C41A6380EC08586AFE (0x05 packet)
Hash: <?> (0x04 packet)
+2 -2
View File
@@ -47,8 +47,8 @@ void WardenWin::Init(WorldSession* session, BigNumber *k)
_session = session;
// Generate Warden Key
SHA1Randx WK(k->AsByteArray(), k->GetNumBytes());
WK.generate(_inputKey, 16);
WK.generate(_outputKey, 16);
WK.Generate(_inputKey, 16);
WK.Generate(_outputKey, 16);
memcpy(_seed, Module.Seed, 16);
@@ -64,7 +64,7 @@ public:
void Reset()
{
if(instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS)
if (instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS)
OpenDoors(false);
instance->SetBossState(DATA_PYROGAURD_EMBERSEER,NOT_STARTED);
// respawn any dead Blackhand Incarcerators
@@ -494,7 +494,7 @@ class spell_rotface_mutated_infection : public SpellScriptLoader
{
// remove targets with this aura already
// tank is not on this list
targets.remove_if (Trinity::UnitAuraCheck(true, GetSpellInfo()->Id));
targets.remove_if(Trinity::UnitAuraCheck(true, GetSpellInfo()->Id));
if (targets.empty())
return;
@@ -1189,7 +1189,7 @@ class spell_dreamwalker_summoner : public SpellScriptLoader
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if (Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED));
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED));
if (targets.empty())
return;
@@ -1238,7 +1238,7 @@ class spell_dreamwalker_summon_suppresser : public SpellScriptLoader
std::list<Creature*> summoners;
GetCreatureListWithEntryInGrid(summoners, caster, NPC_WORLD_TRIGGER, 100.0f);
summoners.remove_if (Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED));
summoners.remove_if(Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED));
Trinity::Containers::RandomResizeList(summoners, 2);
if (summoners.empty())
return;
@@ -1230,7 +1230,7 @@ public:
//bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
//{
// player->PlayerTalkClass->ClearMenus();
// switch(action)
// switch (action)
// {
// case GOSSIP_ACTION_INFO_DEF+1:
// if (player)
@@ -651,7 +651,7 @@ class npc_simon_bunny : public CreatureScript
{
_events.Update(diff);
switch(_events.ExecuteEvent())
switch (_events.ExecuteEvent())
{
case EVENT_SIMON_PERIODIC_PLAYER_CHECK:
if (!CheckPlayer())
@@ -21,50 +21,56 @@
#ifndef _WARDEN_KEY_GENERATION_H
#define _WARDEN_KEY_GENERATION_H
class SHA1Randx {
class SHA1Randx
{
public:
SHA1Randx(uint8 *buff, uint32 size) {
SHA1Randx(uint8* buff, uint32 size)
{
uint32 taken = size/2;
sh.Initialize();
sh.UpdateData(buff,taken);
sh.UpdateData(buff, taken);
sh.Finalize();
memcpy(o1,sh.GetDigest(),20);
memcpy(o1, sh.GetDigest(), 20);
sh.Initialize();
sh.UpdateData(buff+taken,size-taken);
sh.UpdateData(buff + taken, size - taken);
sh.Finalize();
memcpy(o2,sh.GetDigest(),20);
memcpy(o2, sh.GetDigest(), 20);
memset(o0,0x00,20);
memset(o0, 0x00, 20);
fillUp();
FillUp();
}
void generate(uint8 *buf, uint32 sz) {
for(uint32 i=0;i<sz;i++) {
if(taken == 20) {
fillUp();
}
void Generate(uint8* buf, uint32 sz)
{
for (uint32 i = 0; i < sz; ++i)
{
if (taken == 20)
FillUp();
buf[i] = o0[taken];
taken++;
}
}
private:
void fillUp() {
void FillUp()
{
sh.Initialize();
sh.UpdateData(o1,20);
sh.UpdateData(o0,20);
sh.UpdateData(o2,20);
sh.UpdateData(o1, 20);
sh.UpdateData(o0, 20);
sh.UpdateData(o2, 20);
sh.Finalize();
memcpy(o0,sh.GetDigest(),20);
memcpy(o0, sh.GetDigest(), 20);
taken = 0;
}
SHA1Hash sh;
uint32 taken;
uint8 o0[20],o1[20],o2[20];
@@ -209,7 +209,7 @@ m_bind(NULL)
MySQLPreparedStatement::~MySQLPreparedStatement()
{
ClearParameters();
if(m_Mstmt->bind_result_done)
if (m_Mstmt->bind_result_done)
{
delete[] m_Mstmt->bind->length;
delete[] m_Mstmt->bind->is_null;