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:
Regalis
2016-12-17 14:24:54 +02:00
parent b01b38da68
commit 311f388358
5 changed files with 60 additions and 31 deletions
@@ -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;