(51d0e9a7a) Fixed crashing when firing a revolver in the sub editor. Closes #1631
This commit is contained in:
@@ -170,6 +170,7 @@ namespace Barotrauma.Items.Components
|
|||||||
projectile.Item.SetTransform(projectilePos, rotation);
|
projectile.Item.SetTransform(projectilePos, rotation);
|
||||||
|
|
||||||
projectile.Use(deltaTime);
|
projectile.Use(deltaTime);
|
||||||
|
if (projectile.Item.Removed) { return true; }
|
||||||
projectile.User = character;
|
projectile.User = character;
|
||||||
|
|
||||||
projectile.Item.body.ApplyTorque(projectile.Item.body.Mass * degreeOfFailure * Rand.Range(-10.0f, 10.0f));
|
projectile.Item.body.ApplyTorque(projectile.Item.body.Mass * degreeOfFailure * Rand.Range(-10.0f, 10.0f));
|
||||||
|
|||||||
@@ -275,7 +275,14 @@ namespace Barotrauma.Items.Components
|
|||||||
//the raycast didn't hit anything -> the projectile flew somewhere outside the level and is permanently lost
|
//the raycast didn't hit anything -> the projectile flew somewhere outside the level and is permanently lost
|
||||||
if (!hitSomething)
|
if (!hitSomething)
|
||||||
{
|
{
|
||||||
Entity.Spawner.AddToRemoveQueue(item);
|
if (Entity.Spawner == null)
|
||||||
|
{
|
||||||
|
item.Remove();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Entity.Spawner.AddToRemoveQueue(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user