Fix crayon decal spawning exception (#4355)
* Fix crayon spawning * Popup message
This commit is contained in:
@@ -124,9 +124,13 @@ namespace Content.Server.Crayon
|
||||
return true;
|
||||
}
|
||||
|
||||
var entityManager = IoCManager.Resolve<IServerEntityManager>();
|
||||
if (!eventArgs.ClickLocation.IsValid(Owner.EntityManager))
|
||||
{
|
||||
eventArgs.User.PopupMessage(Loc.GetString("crayon-interact-invalid-location"));
|
||||
return true;
|
||||
}
|
||||
|
||||
var entity = entityManager.SpawnEntity("CrayonDecal", eventArgs.ClickLocation);
|
||||
var entity = Owner.EntityManager.SpawnEntity("CrayonDecal", eventArgs.ClickLocation);
|
||||
if (entity.TryGetComponent(out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(CrayonVisuals.State, SelectedState);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
crayon-drawing-label = Drawing: [color={$color}]{$state}[/color] ({$charges}/{$capacity})
|
||||
crayon-interact-not-enough-left-text = Not enough left.
|
||||
crayon-interact-invalid-location = Can't reach there!
|
||||
|
||||
## UI
|
||||
crayon-window-title = Crayon
|
||||
Reference in New Issue
Block a user