Fix decal crash (#7484)
This commit is contained in:
@@ -56,7 +56,7 @@ namespace Content.Client.Decals
|
|||||||
{
|
{
|
||||||
if (!cachedTextures.TryGetValue(decal.Id, out var texture))
|
if (!cachedTextures.TryGetValue(decal.Id, out var texture))
|
||||||
{
|
{
|
||||||
var sprite = _prototypeManager.Index<DecalPrototype>(decal.Id).Sprite;
|
var sprite = GetDecalSprite(decal.Id);
|
||||||
texture = _sprites.Frame0(sprite);
|
texture = _sprites.Frame0(sprite);
|
||||||
cachedTextures[decal.Id] = texture;
|
cachedTextures[decal.Id] = texture;
|
||||||
}
|
}
|
||||||
@@ -69,5 +69,16 @@ namespace Content.Client.Decals
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SpriteSpecifier GetDecalSprite(string id)
|
||||||
|
{
|
||||||
|
if (_prototypeManager.TryIndex<DecalPrototype>(id, out var proto))
|
||||||
|
return proto.Sprite;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Logger.Error($"Unknown decal prototype: {id}");
|
||||||
|
return new SpriteSpecifier.Texture(new ResourcePath("/Textures/noSprite.png"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,14 +129,6 @@ entities:
|
|||||||
color: '#FFFFFFFF'
|
color: '#FFFFFFFF'
|
||||||
id: Grasse1
|
id: Grasse1
|
||||||
coordinates: 13.889501,-4.865914
|
coordinates: 13.889501,-4.865914
|
||||||
10:
|
|
||||||
color: '#FFFFFFFF'
|
|
||||||
id: Rock08
|
|
||||||
coordinates: 3.2020006,-13.537788
|
|
||||||
11:
|
|
||||||
color: '#FFFFFFFF'
|
|
||||||
id: Rock10
|
|
||||||
coordinates: 5.9051256,-13.131538
|
|
||||||
12:
|
12:
|
||||||
color: '#FFFFFFFF'
|
color: '#FFFFFFFF'
|
||||||
id: Flowersbr2
|
id: Flowersbr2
|
||||||
|
|||||||
Reference in New Issue
Block a user