Limbs with no sprite don't cause the game to crash anymore, lightsources attached to a limb are drawn at the interpolated position (= DrawPosition) of the limb, lightTexture origin is flipped on the X-axis when parent limb flips
This commit is contained in:
@@ -85,7 +85,7 @@ namespace Barotrauma
|
||||
texturePaths = new List<string>();
|
||||
foreach (Limb limb in editingCharacter.AnimController.Limbs)
|
||||
{
|
||||
if (texturePaths.Contains(limb.sprite.FilePath)) continue;
|
||||
if (limb.sprite==null || texturePaths.Contains(limb.sprite.FilePath)) continue;
|
||||
textures.Add(limb.sprite.Texture);
|
||||
texturePaths.Add(limb.sprite.FilePath);
|
||||
}
|
||||
@@ -160,7 +160,7 @@ namespace Barotrauma
|
||||
|
||||
foreach (Limb limb in editingCharacter.AnimController.Limbs)
|
||||
{
|
||||
if (limb.sprite.FilePath != texturePaths[i]) continue;
|
||||
if (limb.sprite == null || limb.sprite.FilePath != texturePaths[i]) continue;
|
||||
Rectangle rect = limb.sprite.SourceRect;
|
||||
rect.X += x;
|
||||
rect.Y += y;
|
||||
|
||||
Reference in New Issue
Block a user