fix chameleon projector ripley bug (#35070)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -44,6 +44,8 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem
|
||||
SubscribeLocalEvent<ChameleonDisguiseComponent, InsertIntoEntityStorageAttemptEvent>(OnDisguiseInsertAttempt);
|
||||
SubscribeLocalEvent<ChameleonDisguiseComponent, ComponentShutdown>(OnDisguiseShutdown);
|
||||
|
||||
SubscribeLocalEvent<ChameleonDisguisedComponent, EntGotInsertedIntoContainerMessage>(OnDisguisedInserted);
|
||||
|
||||
SubscribeLocalEvent<ChameleonProjectorComponent, AfterInteractEvent>(OnInteract);
|
||||
SubscribeLocalEvent<ChameleonProjectorComponent, GetVerbsEvent<UtilityVerb>>(OnGetVerbs);
|
||||
SubscribeLocalEvent<ChameleonProjectorComponent, DisguiseToggleNoRotEvent>(OnToggleNoRot);
|
||||
@@ -72,6 +74,7 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem
|
||||
{
|
||||
// stay parented to the user, not the storage
|
||||
args.Cancelled = true;
|
||||
TryReveal(ent.Comp.User);
|
||||
}
|
||||
|
||||
private void OnDisguiseShutdown(Entity<ChameleonDisguiseComponent> ent, ref ComponentShutdown args)
|
||||
@@ -81,6 +84,16 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem
|
||||
|
||||
#endregion
|
||||
|
||||
#region Disguised player
|
||||
|
||||
private void OnDisguisedInserted(Entity<ChameleonDisguisedComponent> ent, ref EntGotInsertedIntoContainerMessage args)
|
||||
{
|
||||
// prevent player going into locker/mech/etc while disguised
|
||||
TryReveal((ent, ent));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Projector
|
||||
|
||||
private void OnInteract(Entity<ChameleonProjectorComponent> ent, ref AfterInteractEvent args)
|
||||
@@ -111,7 +124,7 @@ public abstract class SharedChameleonProjectorSystem : EntitySystem
|
||||
|
||||
public bool TryDisguise(Entity<ChameleonProjectorComponent> ent, EntityUid user, EntityUid target)
|
||||
{
|
||||
if (_container.IsEntityInContainer(target))
|
||||
if (_container.IsEntityInContainer(target) || _container.IsEntityInContainer(user))
|
||||
{
|
||||
_popup.PopupClient(Loc.GetString("chameleon-projector-inside-container"), target, user);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user