Misc Fixes

This commit is contained in:
hondacrx
2017-07-02 00:48:40 -04:00
parent 8b78fc7361
commit 9f1ded7797
8 changed files with 24 additions and 34 deletions
+3 -3
View File
@@ -39,7 +39,7 @@
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>..\Build\x64\Release\</OutputPath>
@@ -48,7 +48,7 @@
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
@@ -181,7 +181,7 @@
<Compile Include="GameMath\Matrix2.cs" />
<Compile Include="GameMath\Matrix3.cs" />
<Compile Include="GameMath\Matrix4.cs" />
<Compile Include="GameMath\QuaternionD.cs" />
<Compile Include="GameMath\Quaternion.cs" />
<Compile Include="GameMath\Ray.cs" />
<Compile Include="Networking\SSLSocket.cs" />
<Compile Include="Constants\ServiceHash.cs" />
+14 -25
View File
@@ -284,7 +284,6 @@ namespace Game.DataStorage
}
string str = locStr[locale];
buffer.WriteUInt16(str.Length + 1);
buffer.WriteCString(str);
break;
}
@@ -296,54 +295,44 @@ namespace Game.DataStorage
void WriteArrayValues(object entry, FieldInfo fieldInfo, ByteBuffer buffer)
{
var type = fieldInfo.FieldType.GetElementType();
var length = ((Array)fieldInfo.GetValue(entry)).Length;
for (var i = 0; i < length; ++i)
var array = (Array)fieldInfo.GetValue(entry);
for (var i = 0; i < array.Length; ++i)
{
var value = (Array)fieldInfo.GetValue(entry);
switch (Type.GetTypeCode(type))
{
case TypeCode.Boolean:
buffer.WriteUInt8(value.GetValue(i));
buffer.WriteUInt8(array.GetValue(i));
break;
case TypeCode.SByte:
buffer.WriteInt8(value.GetValue(i));
buffer.WriteInt8(array.GetValue(i));
break;
case TypeCode.Byte:
buffer.WriteUInt8(value.GetValue(i));
buffer.WriteUInt8(array.GetValue(i));
break;
case TypeCode.Int16:
buffer.WriteInt16(value.GetValue(i));
buffer.WriteInt16(array.GetValue(i));
break;
case TypeCode.UInt16:
buffer.WriteUInt16(value.GetValue(i));
buffer.WriteUInt16(array.GetValue(i));
break;
case TypeCode.Int32:
buffer.WriteInt32(value.GetValue(i));
buffer.WriteInt32(array.GetValue(i));
break;
case TypeCode.UInt32:
buffer.WriteUInt32(value.GetValue(i));
buffer.WriteUInt32(array.GetValue(i));
break;
case TypeCode.Int64:
buffer.WriteInt64(value.GetValue(i));
buffer.WriteInt64(array.GetValue(i));
break;
case TypeCode.UInt64:
buffer.WriteUInt64(value.GetValue(i));
buffer.WriteUInt64(array.GetValue(i));
break;
case TypeCode.Single:
buffer.WriteFloat(value.GetValue(i));
buffer.WriteFloat(array.GetValue(i));
break;
case TypeCode.String:
var str = (string)value.GetValue(i);
buffer.WriteInt32(str.Length);
buffer.WriteString(str);
break;
case TypeCode.Object:
switch (type.Name)
{
case "Unused":
buffer.WriteUInt32(0u);
break;
}
var str = (string)array.GetValue(i);
buffer.WriteCString(str);
break;
}
}
+1 -1
View File
@@ -145,7 +145,7 @@ namespace Game.DataStorage
foreach (CurvePointRecord curvePoint in CliDB.CurvePointStorage.Values)
{
if (CliDB.CurveStorage.ContainsKey(curvePoint.CurveID))
_curvePoints[curvePoint.CurveID].Add(curvePoint);
_curvePoints.Add(curvePoint.CurveID, curvePoint);
}
foreach (var key in _curvePoints.Keys.ToList())
+2 -2
View File
@@ -167,8 +167,8 @@ namespace Game.Entities
if (xp != 0)
{
// 4.2.2. Apply auras modifying rewarded XP (SPELL_AURA_MOD_XP_PCT and SPELL_AURA_MOD_XP_FROM_CREATURE_TYPE).
xp *= (uint)player.GetTotalAuraMultiplier(AuraType.ModXpPct);
xp *= (uint)player.GetTotalAuraMultiplierByMiscValue(AuraType.ModXpFromCreatureType, (int)_victim.GetCreatureType());
xp = (uint)(xp * player.GetTotalAuraMultiplier(AuraType.ModXpPct));
xp = (uint)(xp * player.GetTotalAuraMultiplierByMiscValue(AuraType.ModXpFromCreatureType, (int)_victim.GetCreatureType()));
// 4.2.3. Give XP to player.
player.GiveXP(xp, _victim, _groupRate);
+1 -1
View File
@@ -4232,7 +4232,7 @@ namespace Game.Entities
if (spellproto == null)
continue;
if (spellproto.HasAura(GetMap().GetDifficultyID(), AuraType.ModXpPct) || !GetSession().GetCollectionMgr().CanApplyHeirloomXpBonus(item.GetEntry(), getLevel())
if (spellproto.HasAura(GetMap().GetDifficultyID(), AuraType.ModXpPct) && !GetSession().GetCollectionMgr().CanApplyHeirloomXpBonus(item.GetEntry(), getLevel())
&& Global.DB2Mgr.GetHeirloomByItemId(item.GetEntry()) != null)
continue;
+1 -1
View File
@@ -1484,7 +1484,7 @@ namespace Game.Entities
float value = GetTotalPercentageModValue(modGroup) + GetRatingBonusValue(cr);
// Modify crit from weapon skill and maximized defense skill of same level victim difference
value += GetMaxSkillValueForLevel() - GetMaxSkillValueForLevel() * 0.04f;
value += (GetMaxSkillValueForLevel() - GetMaxSkillValueForLevel()) * 0.04f;
if (WorldConfig.GetBoolValue(WorldCfg.StatsLimitsEnable))
value = value > WorldConfig.GetFloatValue(WorldCfg.StatsLimitsCrit) ? WorldConfig.GetFloatValue(WorldCfg.StatsLimitsCrit) : value;
+1
View File
@@ -1124,6 +1124,7 @@ namespace Game.Scripting
case AuraScriptHookType.EffectAbsorb:
case AuraScriptHookType.EffectSplit:
case AuraScriptHookType.PrepareProc:
case AuraScriptHookType.Proc:
case AuraScriptHookType.EffectProc:
return m_defaultActionPrevented;
default:
+1 -1
View File
@@ -956,7 +956,7 @@ namespace Game.Spells
{
Creature targetCreature = unitTarget.ToCreature();
if (targetCreature != null)
if (targetCreature.hasLootRecipient() && targetCreature.isTappedBy(caster.ToPlayer()))
if (targetCreature.hasLootRecipient() && !targetCreature.isTappedBy(caster.ToPlayer()))
return SpellCastResult.CantCastOnTapped;
}