Permit ReagentEffect PopupMessage to access the solutionEntity it occurs in. (#11537)

This commit is contained in:
Vordenburg
2022-10-03 21:46:54 -04:00
committed by GitHub
parent 020b2fae00
commit c58538a9fe

View File

@@ -22,10 +22,14 @@ namespace Content.Server.Chemistry.ReagentEffects
var random = IoCManager.Resolve<IRobustRandom>();
var msg = random.Pick(Messages);
var msgArgs = new (string, object)[] {
("entity", args.SolutionEntity),
("organ", args.OrganEntity.GetValueOrDefault()),
};
if (Type == PopupRecipients.Local)
popupSys.PopupEntity(Loc.GetString(msg), args.SolutionEntity, Filter.Entities(args.SolutionEntity), VisualType);
popupSys.PopupEntity(Loc.GetString(msg, msgArgs), args.SolutionEntity, Filter.Entities(args.SolutionEntity), VisualType);
else if (Type == PopupRecipients.Pvs)
popupSys.PopupEntity(Loc.GetString(msg), args.SolutionEntity, Filter.Pvs(args.SolutionEntity), VisualType);
popupSys.PopupEntity(Loc.GetString(msg, msgArgs), args.SolutionEntity, Filter.Pvs(args.SolutionEntity), VisualType);
}
}