Fixes bad expressions, bad bool checks in loops, a few null pointer exceptions, and optimizes constructors.

This commit is contained in:
Kamron Batman 2018-09-15 23:16:45 -07:00
parent 8da55d6043
commit f93c3b992e
62 changed files with 318 additions and 634 deletions

View file

@ -7,11 +7,10 @@ namespace Server.Items
{
int itemID = 4280;
int count = 5;
bool leftToRight = false;
for (int i = 0; i < count; ++i)
AddComponent(new AddonComponent(itemID++), leftToRight ? i : count - 1 - i,
-(leftToRight ? i : count - 1 - i), 0);
AddComponent(new AddonComponent(itemID++), count - 1 - i,
-(count - 1 - i), 0);
}
public GiantWeb1(Serial serial)
@ -41,11 +40,10 @@ namespace Server.Items
{
int itemID = 4285;
int count = 5;
bool leftToRight = true;
for (int i = 0; i < count; ++i)
AddComponent(new AddonComponent(itemID++), leftToRight ? i : count - 1 - i,
-(leftToRight ? i : count - 1 - i), 0);
AddComponent(new AddonComponent(itemID++), i,
-i, 0);
}
public GiantWeb2(Serial serial)
@ -75,11 +73,10 @@ namespace Server.Items
{
int itemID = 4290;
int count = 4;
bool leftToRight = true;
for (int i = 0; i < count; ++i)
AddComponent(new AddonComponent(itemID++), leftToRight ? i : count - 1 - i,
-(leftToRight ? i : count - 1 - i), 0);
AddComponent(new AddonComponent(itemID++), i,
-i, 0);
}
public GiantWeb3(Serial serial)
@ -109,11 +106,10 @@ namespace Server.Items
{
int itemID = 4294;
int count = 4;
bool leftToRight = false;
for (int i = 0; i < count; ++i)
AddComponent(new AddonComponent(itemID++), leftToRight ? i : count - 1 - i,
-(leftToRight ? i : count - 1 - i), 0);
AddComponent(new AddonComponent(itemID++), count - 1 - i,
-(count - 1 - i), 0);
}
public GiantWeb4(Serial serial)
@ -143,11 +139,10 @@ namespace Server.Items
{
int itemID = 4298;
int count = 4;
bool leftToRight = true;
for (int i = 0; i < count; ++i)
AddComponent(new AddonComponent(itemID++), leftToRight ? i : count - 1 - i,
-(leftToRight ? i : count - 1 - i), 0);
AddComponent(new AddonComponent(itemID++), i,
-i, 0);
}
public GiantWeb5(Serial serial)
@ -177,11 +172,10 @@ namespace Server.Items
{
int itemID = 4302;
int count = 4;
bool leftToRight = false;
for (int i = 0; i < count; ++i)
AddComponent(new AddonComponent(itemID++), leftToRight ? i : count - 1 - i,
-(leftToRight ? i : count - 1 - i), 0);
AddComponent(new AddonComponent(itemID++), count - 1 - i,
-(count - 1 - i), 0);
}
public GiantWeb6(Serial serial)