Fix crayon losing durability on stamped paper (#34202)
This commit is contained in:
@@ -101,22 +101,25 @@ public sealed class PaperSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
// only allow editing if there are no stamps or when using a cyberpen
|
// only allow editing if there are no stamps or when using a cyberpen
|
||||||
var editable = entity.Comp.StampedBy.Count == 0 || _tagSystem.HasTag(args.Used, "WriteIgnoreStamps");
|
var editable = entity.Comp.StampedBy.Count == 0 || _tagSystem.HasTag(args.Used, "WriteIgnoreStamps");
|
||||||
if (_tagSystem.HasTag(args.Used, "Write") && editable)
|
if (_tagSystem.HasTag(args.Used, "Write"))
|
||||||
{
|
{
|
||||||
if (entity.Comp.EditingDisabled)
|
if (editable)
|
||||||
{
|
{
|
||||||
var paperEditingDisabledMessage = Loc.GetString("paper-tamper-proof-modified-message");
|
if (entity.Comp.EditingDisabled)
|
||||||
_popupSystem.PopupEntity(paperEditingDisabledMessage, entity, args.User);
|
{
|
||||||
|
var paperEditingDisabledMessage = Loc.GetString("paper-tamper-proof-modified-message");
|
||||||
|
_popupSystem.PopupEntity(paperEditingDisabledMessage, entity, args.User);
|
||||||
|
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
var writeEvent = new PaperWriteEvent(entity, args.User);
|
||||||
|
RaiseLocalEvent(args.Used, ref writeEvent);
|
||||||
|
|
||||||
|
entity.Comp.Mode = PaperAction.Write;
|
||||||
|
_uiSystem.OpenUi(entity.Owner, PaperUiKey.Key, args.User);
|
||||||
|
UpdateUserInterface(entity);
|
||||||
}
|
}
|
||||||
var writeEvent = new PaperWriteEvent(entity, args.User);
|
|
||||||
RaiseLocalEvent(args.Used, ref writeEvent);
|
|
||||||
|
|
||||||
entity.Comp.Mode = PaperAction.Write;
|
|
||||||
_uiSystem.OpenUi(entity.Owner, PaperUiKey.Key, args.User);
|
|
||||||
UpdateUserInterface(entity);
|
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user