All items and structures have to define a sourcerect for the sprite because otherwise the dedicated server won't know the size of the entity. Closes #321
This commit is contained in:
@@ -308,6 +308,10 @@ namespace Barotrauma
|
||||
canSpriteFlipX = subElement.GetAttributeBool("canflipx", true);
|
||||
|
||||
sprite = new Sprite(subElement, spriteFolder);
|
||||
if (subElement.Attribute("sourcerect") == null)
|
||||
{
|
||||
DebugConsole.ThrowError("Warning - sprite sourcerect not configured for item \"" + Name + "\"!");
|
||||
}
|
||||
size = sprite.size;
|
||||
break;
|
||||
#if CLIENT
|
||||
|
||||
@@ -99,6 +99,10 @@ namespace Barotrauma
|
||||
{
|
||||
case "sprite":
|
||||
sp.sprite = new Sprite(subElement);
|
||||
if (subElement.Attribute("sourcerect") == null)
|
||||
{
|
||||
DebugConsole.ThrowError("Warning - sprite sourcerect not configured for structure \"" + sp.name + "\"!");
|
||||
}
|
||||
|
||||
if (subElement.GetAttributeBool("fliphorizontal", false))
|
||||
sp.sprite.effects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Reference in New Issue
Block a user