Functional networkevent validation, functional single player saving, requireditem ui texts, titlescreen & loading
This commit is contained in:
@@ -37,17 +37,19 @@ namespace Subsurface.Items.Components
|
||||
if (picker == null) return false;
|
||||
if (picker.Inventory == null) return false;
|
||||
|
||||
this.picker = picker;
|
||||
//this.picker = picker;
|
||||
|
||||
for (int i = item.linkedTo.Count - 1; i >= 0; i--)
|
||||
item.linkedTo[i].RemoveLinked(item);
|
||||
item.linkedTo.Clear();
|
||||
|
||||
|
||||
if (picker.Inventory.TryPutItem(item, allowedSlots))
|
||||
{
|
||||
if (!picker.HasSelectedItem(item) && item.body!=null) item.body.Enabled = false;
|
||||
this.picker = picker;
|
||||
|
||||
for (int i = item.linkedTo.Count - 1; i >= 0; i--)
|
||||
item.linkedTo[i].RemoveLinked(item);
|
||||
item.linkedTo.Clear();
|
||||
|
||||
ApplyStatusEffects(ActionType.OnPicked, 1.0f, picker);
|
||||
|
||||
//foreach (StatusEffect effect in item.Prefab.statusEffects)
|
||||
|
||||
@@ -94,22 +94,16 @@ namespace Subsurface.Items.Components
|
||||
projectile.body.ApplyTorque(projectile.body.Mass * Rand.Range(-10.0f, 10.0f));
|
||||
|
||||
//recoil
|
||||
item.body.ApplyLinearImpulse(
|
||||
new Vector2((float)Math.Cos(projectile.body.Rotation), (float)Math.Sin(projectile.body.Rotation)) * item.body.Mass * -10.0f);
|
||||
|
||||
if (Rand.Int(2) == 0)
|
||||
{
|
||||
item.Drop(character);
|
||||
item.body.ApplyTorque(projectile.body.Mass * Rand.Range(-10.0f, 10.0f));
|
||||
}
|
||||
//item.body.ApplyLinearImpulse(
|
||||
// new Vector2((float)Math.Cos(projectile.body.Rotation), (float)Math.Sin(projectile.body.Rotation)) * item.body.Mass * -10.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
projectileComponent.ignoredBodies = limbBodies;
|
||||
|
||||
//recoil
|
||||
item.body.ApplyLinearImpulse(
|
||||
new Vector2((float)Math.Cos(projectile.body.Rotation), (float)Math.Sin(projectile.body.Rotation)) * -item.body.Mass);
|
||||
//item.body.ApplyLinearImpulse(
|
||||
// new Vector2((float)Math.Cos(projectile.body.Rotation), (float)Math.Sin(projectile.body.Rotation)) * -item.body.Mass);
|
||||
}
|
||||
|
||||
item.RemoveContained(projectile);
|
||||
|
||||
Reference in New Issue
Block a user