Networking bugfixes & optimization
This commit is contained in:
@@ -66,7 +66,9 @@ namespace Subsurface.Items.Components
|
||||
{
|
||||
this.cam = cam;
|
||||
|
||||
if (character == null || character.SelectedConstruction != item)
|
||||
if (character == null
|
||||
|| character.SelectedConstruction != item
|
||||
|| Vector2.Distance(character.SimPosition, item.SimPosition) > item.PickDistance * 1.5f)
|
||||
{
|
||||
if (character != null)
|
||||
{
|
||||
|
||||
@@ -239,24 +239,15 @@ namespace Subsurface.Items.Components
|
||||
|
||||
new RepairTask(item, 60.0f, "Reactor meltdown!");
|
||||
item.Condition = 0.0f;
|
||||
//fissionRate = 0.0f;
|
||||
//coolingRate = 0.0f;
|
||||
|
||||
//PlaySound(ActionType.OnFailure, item.Position);
|
||||
//item.ApplyStatusEffects(ActionType.OnFailure, 1.0f, null);
|
||||
|
||||
//new Explosion(item.SimPosition, 6.0f, 500.0f, 600.0f, 10.0f, 2.0f).Explode();
|
||||
var containedItems = item.ContainedItems;
|
||||
if (containedItems == null) return;
|
||||
|
||||
if (item.ContainedItems!=null)
|
||||
foreach (Item containedItem in item.ContainedItems)
|
||||
{
|
||||
foreach (Item containedItem in item.ContainedItems)
|
||||
{
|
||||
if (containedItem == null) continue;
|
||||
containedItem.Condition = 0.0f;
|
||||
}
|
||||
if (containedItem == null) continue;
|
||||
containedItem.Condition = 0.0f;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override bool Pick(Character picker)
|
||||
|
||||
@@ -173,16 +173,19 @@ namespace Subsurface.Items.Components
|
||||
(float)Math.Cos(item.body.Rotation),
|
||||
(float)Math.Sin(item.body.Rotation));
|
||||
|
||||
if (Vector2.Dot(f1.Body.LinearVelocity, normal)<0 ) return StickToTarget(f2.Body, dir);
|
||||
if (Vector2.Dot(f1.Body.LinearVelocity, normal) < 0.0f) return StickToTarget(f2.Body, dir);
|
||||
}
|
||||
|
||||
foreach (Item contained in item.ContainedItems)
|
||||
|
||||
var containedItems = item.ContainedItems;
|
||||
if (containedItems == null) return true;
|
||||
foreach (Item contained in containedItems)
|
||||
{
|
||||
contained.Condition = 0.0f;
|
||||
if (contained.body != null)
|
||||
{
|
||||
contained.body.SetTransform(item.SimPosition, contained.body.Rotation);
|
||||
contained.SetTransform(item.SimPosition, contained.body.Rotation);
|
||||
}
|
||||
contained.Condition = 0.0f;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user