From f4f19ac255af296d71a5bb4b97411ae79727fcb3 Mon Sep 17 00:00:00 2001 From: maximius Date: Thu, 29 Oct 2009 18:24:19 -0700 Subject: [PATCH] *Add a missing change from 6097_world_loot_template.sql, thanks amsjunior123 *Some minor cleanup. --HG-- branch : trunk --- sql/updates/6110_world_loot_template.sql | 2 ++ src/game/SpellEffects.cpp | 43 +++++++++++------------- 2 files changed, 22 insertions(+), 23 deletions(-) create mode 100644 sql/updates/6110_world_loot_template.sql diff --git a/sql/updates/6110_world_loot_template.sql b/sql/updates/6110_world_loot_template.sql new file mode 100644 index 0000000000..b0e2de566e --- /dev/null +++ b/sql/updates/6110_world_loot_template.sql @@ -0,0 +1,2 @@ + +ALTER TABLE `spell_loot_template` ADD COLUMN `lootmode` SMALLINT UNSIGNED NOT NULL DEFAULT 1 AFTER `ChanceOrQuestChance`; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 5a69134490..db686d660e 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -6346,37 +6346,34 @@ void Spell::EffectLeapForward(uint32 i) desty = y + dist * sin(orientation); ground = unitTarget->GetMap()->GetHeight(destx,desty,MAX_HEIGHT,true); floor = unitTarget->GetMap()->GetHeight(destx,desty,z, true); - destz = fabs(ground - z) <= fabs(floor - z) ? ground:floor; + destz = fabs(ground - z) <= fabs(floor - z) ? ground : floor; bool col = VMAP::VMapFactory::createOrGetVMapManager()->getObjectHitPos(mapid,x,y,z+0.5f,destx,desty,destz+0.5f,destx,desty,destz,-0.5f); - if(col) // We had a collision! + if (col) // We had a collision! { - destx -= 0.6 * cos(orientation); - desty -= 0.6 * sin(orientation); - dist = sqrt((x-destx)*(x-destx) + (y-desty)*(y-desty)); - step = dist/10.0f; + destx -= 0.6 * cos(orientation); + desty -= 0.6 * sin(orientation); + dist = sqrt((x-destx)*(x-destx) + (y-desty)*(y-desty)); + step = dist/10.0f; } int j = 0; - for (j; j<10 ; j++) - { - if(fabs(z - destz) > 6) - { - destx -= step * cos(orientation); - desty -= step * sin(orientation); - ground = unitTarget->GetMap()->GetHeight(destx,desty,MAX_HEIGHT,true); - floor = unitTarget->GetMap()->GetHeight(destx,desty,z, true); - destz = fabs(ground - z) <= fabs(floor - z) ? ground:floor; - }else - break; - } - if(j == 9) - { - return; - } - unitTarget->NearTeleportTo(destx, desty, destz + 0.07531, orientation, unitTarget==m_caster); + for (j; j < 10; j++) + { + if (fabs(z - destz) > 6) + { + destx -= step * cos(orientation); + desty -= step * sin(orientation); + ground = unitTarget->GetMap()->GetHeight(destx,desty,MAX_HEIGHT,true); + floor = unitTarget->GetMap()->GetHeight(destx,desty,z, true); + destz = fabs(ground - z) <= fabs(floor - z) ? ground:floor; + } else break; + } + if (j == 9) + return; + unitTarget->NearTeleportTo(destx, desty, destz + 0.07531, orientation, unitTarget==m_caster); } void Spell::EffectReputation(uint32 i)