Core/SpellScripts: fix crash caused my spell_gen_vehicle_scaling. closes #5703 (thx vincent-michael)

This commit is contained in:
kandera committed 2012-03-14 14:05:39 -03:00
1 parent fedb27b601
commit b02a012b47
1 file changed
+7 -2
+7 -2
View File
@@ -1312,6 +1312,11 @@ class spell_gen_launch : public SpellScriptLoader
}
};
enum VehicleScaling
{
SPELL_GEAR_SCALING = 66668,
};
class spell_gen_vehicle_scaling : public SpellScriptLoader
{
public:
@@ -1323,7 +1328,7 @@ class spell_gen_vehicle_scaling : public SpellScriptLoader
bool Load()
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
@@ -1335,7 +1340,7 @@ class spell_gen_vehicle_scaling : public SpellScriptLoader
// TODO: Reserach coeffs for different vehicles
switch (GetId())
{
case 66668:
case SPELL_GEAR_SCALING:
factor = 1.0f;
baseItemLevel = 205;
break;