Some cleanups
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
*/
|
||||
using System;
|
||||
|
||||
namespace Framework.Constants
|
||||
{
|
||||
@@ -25,6 +26,7 @@ namespace Framework.Constants
|
||||
OutOfRangeObjects = 3,
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum UpdateFieldFlag
|
||||
{
|
||||
None = 0,
|
||||
|
||||
@@ -1245,7 +1245,6 @@ namespace Game.Chat
|
||||
if (string.IsNullOrEmpty(guid_str))
|
||||
return false;
|
||||
|
||||
ulong lowguid;
|
||||
Creature creature = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(dontdel_str))
|
||||
@@ -1279,11 +1278,10 @@ namespace Game.Chat
|
||||
creature = handler.GetSelectedCreature();
|
||||
if (!creature || creature.IsPet())
|
||||
return false;
|
||||
lowguid = creature.GetSpawnId();
|
||||
}
|
||||
else // case .setmovetype #creature_guid $move_type (with selected creature)
|
||||
{
|
||||
if (!ulong.TryParse(guid_str, out lowguid) || lowguid != 0)
|
||||
if (!ulong.TryParse(guid_str, out ulong lowguid) || lowguid != 0)
|
||||
creature = handler.GetCreatureFromPlayerMapByDbGuid(lowguid);
|
||||
|
||||
// attempt check creature existence by DB data
|
||||
@@ -1296,10 +1294,6 @@ namespace Game.Chat
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lowguid = creature.GetSpawnId();
|
||||
}
|
||||
}
|
||||
|
||||
// now lowguid is low guid really existed creature
|
||||
@@ -1331,7 +1325,7 @@ namespace Game.Chat
|
||||
}
|
||||
creature.SaveToDB();
|
||||
}
|
||||
if (doNotDelete == false)
|
||||
if (!doNotDelete)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.MoveTypeSet, type);
|
||||
}
|
||||
|
||||
@@ -463,7 +463,6 @@ namespace Game
|
||||
SpellClickEventConditionStore[cond.SourceGroup] = new MultiMap<uint, Condition>();
|
||||
|
||||
SpellClickEventConditionStore[cond.SourceGroup].Add((uint)cond.SourceEntry, cond);
|
||||
valid = true;
|
||||
++count;
|
||||
continue; // do not add to m_AllocatedMemory to avoid double deleting
|
||||
}
|
||||
@@ -476,7 +475,6 @@ namespace Game
|
||||
VehicleSpellConditionStore[cond.SourceGroup] = new MultiMap<uint, Condition>();
|
||||
|
||||
VehicleSpellConditionStore[cond.SourceGroup].Add((uint)cond.SourceEntry, cond);
|
||||
valid = true;
|
||||
++count;
|
||||
continue; // do not add to m_AllocatedMemory to avoid double deleting
|
||||
}
|
||||
@@ -488,7 +486,6 @@ namespace Game
|
||||
SmartEventConditionStore[key] = new MultiMap<uint, Condition>();
|
||||
|
||||
SmartEventConditionStore[key].Add(cond.SourceGroup, cond);
|
||||
valid = true;
|
||||
++count;
|
||||
continue;
|
||||
}
|
||||
@@ -498,7 +495,6 @@ namespace Game
|
||||
NpcVendorConditionContainerStore[cond.SourceGroup] = new MultiMap<uint, Condition>();
|
||||
|
||||
NpcVendorConditionContainerStore[cond.SourceGroup].Add((uint)cond.SourceEntry, cond);
|
||||
valid = true;
|
||||
++count;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -137,7 +137,6 @@ namespace Game.Entities
|
||||
|
||||
UpdateType updateType = UpdateType.CreateObject;
|
||||
TypeId tempObjectType = ObjectTypeId;
|
||||
TypeMask tempObjectTypeMask = ObjectTypeMask;
|
||||
CreateObjectBits flags = m_updateFlag;
|
||||
|
||||
if (target == this)
|
||||
@@ -145,7 +144,6 @@ namespace Game.Entities
|
||||
flags.ThisIsYou = true;
|
||||
flags.ActivePlayer = true;
|
||||
tempObjectType = TypeId.ActivePlayer;
|
||||
tempObjectTypeMask |= TypeMask.ActivePlayer;
|
||||
}
|
||||
|
||||
switch (GetGUID().GetHigh())
|
||||
|
||||
@@ -1257,7 +1257,7 @@ namespace Game.Entities
|
||||
|
||||
public override void UpdateAttackPowerAndDamage(bool ranged = false)
|
||||
{
|
||||
float val2 = 0.0f;
|
||||
float val2;
|
||||
float level = GetLevel();
|
||||
|
||||
var entry = CliDB.ChrClassesStorage.LookupByKey(GetClass());
|
||||
@@ -2114,7 +2114,7 @@ namespace Game.Entities
|
||||
|
||||
public override void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, out float minDamage, out float maxDamage)
|
||||
{
|
||||
float variance = 1.0f;
|
||||
float variance;
|
||||
UnitMods unitMod;
|
||||
switch (attType)
|
||||
{
|
||||
|
||||
@@ -3021,8 +3021,8 @@ namespace Game.Maps
|
||||
// also not allow unloading spawn grid to prevent creating creature clone at load
|
||||
if (!c.IsPet() && c.GetSpawnId() != 0)
|
||||
{
|
||||
float x, y, z;
|
||||
c.GetRespawnPosition(out x, out y, out z);
|
||||
float x, y;
|
||||
c.GetRespawnPosition(out x, out y, out _);
|
||||
GridCoord p = GridDefines.ComputeGridCoord(x, y);
|
||||
if (GetGrid(p.X_coord, p.Y_coord) != null)
|
||||
GetGrid(p.X_coord, p.Y_coord).IncUnloadActiveLock();
|
||||
@@ -3052,8 +3052,8 @@ namespace Game.Maps
|
||||
// also allow unloading spawn grid
|
||||
if (!c.IsPet() && c.GetSpawnId() != 0)
|
||||
{
|
||||
float x, y, z;
|
||||
c.GetRespawnPosition(out x, out y, out z);
|
||||
float x, y;
|
||||
c.GetRespawnPosition(out x, out y, out _);
|
||||
GridCoord p = GridDefines.ComputeGridCoord(x, y);
|
||||
if (GetGrid(p.X_coord, p.Y_coord) != null)
|
||||
GetGrid(p.X_coord, p.Y_coord).DecUnloadActiveLock();
|
||||
|
||||
@@ -2318,6 +2318,8 @@ namespace Game
|
||||
public bool IsShuttingDown() { return m_ShutdownTimer > 0; }
|
||||
public uint GetShutDownTimeLeft() { return m_ShutdownTimer; }
|
||||
|
||||
public int GetExitCode() { return (int)m_ExitCode; }
|
||||
|
||||
public void StopNow(ShutdownExitCode exitcode = ShutdownExitCode.Error) { IsStopped = true; m_ExitCode = exitcode; }
|
||||
|
||||
public bool IsPvPRealm()
|
||||
|
||||
@@ -1699,7 +1699,6 @@ namespace Game.Spells
|
||||
DamageInfo damageInfo = eventInfo.GetDamageInfo();
|
||||
if (damageInfo != null)
|
||||
{
|
||||
WeaponAttackType attType = damageInfo.GetAttackType();
|
||||
if (damageInfo.GetAttackType() != WeaponAttackType.OffAttack)
|
||||
item = target.ToPlayer().GetUseableItemByPos(InventorySlots.Bag0, EquipmentSlot.MainHand);
|
||||
else
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace WorldServer
|
||||
{
|
||||
Log.outInfo(LogFilter.Server, "Halting process...");
|
||||
Thread.Sleep(5000);
|
||||
Environment.Exit(-1);
|
||||
Environment.Exit(Global.WorldMgr.GetExitCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user