Prevent picking up chameleon projector disguises via context menu (#42656)

This commit is contained in:
B_Kirill 2026-01-26 23:48:16 +10:00 committed by Coryler
parent e2f1025965
commit b1af38a6ff
1 changed files with 7 additions and 0 deletions

View File

@ -46,6 +46,7 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem
SubscribeLocalEvent<ChameleonDisguiseComponent, DamageChangedEvent>(OnDisguiseDamaged);
SubscribeLocalEvent<ChameleonDisguiseComponent, InsertIntoEntityStorageAttemptEvent>(OnDisguiseInsertAttempt);
SubscribeLocalEvent<ChameleonDisguiseComponent, ComponentShutdown>(OnDisguiseShutdown);
SubscribeLocalEvent<ChameleonDisguiseComponent, BeforeGettingEquippedHandEvent>(OnDisguiseBeforeEquippedHand);
SubscribeLocalEvent<ChameleonDisguisedComponent, EntGotInsertedIntoContainerMessage>(OnDisguisedInserted);
@ -86,6 +87,12 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem
_actions.RemoveProvidedActions(ent.Comp.User, ent.Comp.Projector);
}
private void OnDisguiseBeforeEquippedHand(Entity<ChameleonDisguiseComponent> ent, ref BeforeGettingEquippedHandEvent args)
{
args.Cancelled = true;
TryReveal(ent.Comp.User);
}
#endregion
#region Disguised player