Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Antag Ctrl on the same mob multiple times for the same antag creates undesired outcomes #33850

Open
Errant-4 opened this issue Dec 13, 2024 · 0 comments
Labels
D2: Medium Difficulty: A good amount of codebase knowledge required. Issue: Replicated This issue has been replicated by another user. P3: Standard Priority: Default priority for repository items.

Comments

@Errant-4
Copy link
Member

Errant-4 commented Dec 13, 2024

Description

Adding Thief, Head Rev, Initial Infected or LoneOp multiple times creates duplicate briefing on the Character screen

Adding Traitor a second time additionally causes a debug assert on the server that crashes the debug (it tries to add a second RoleBriefingComponent somewhere, probably TraitorRuleSystem finding and using the existing traitor mindrole rather than adding a new one?)

Reproduction

  • Spawn in dev
  • Right click your mob
  • Antag ctrl > Traitor
  • Repeat last step

Additional context

[DEBG] system.traitor_rule: MakeTraitor Operative Uniform (2955/n2955, MobVox, localhost@Player_A) - Uplink add
[FATL] unhandled: System.ArgumentException: An item with the same key has already been added. Key: usualDiscounts
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Content.Shared.Store.ListingDataWithCostModifiers.AddCostModifier(String modifierSourceId, Dictionary`2 modifiers) in /home/user/space-station-14/Content.Shared/Store/ListingPrototype.cs:line 324
   at Content.Server.StoreDiscount.Systems.StoreDiscountSystem.ApplyDiscounts(IReadOnlyList`1 listings, IReadOnlyCollection`1 discounts) in /home/user/space-station-14/Content.Server/StoreDiscount/Systems/StoreDiscountSystem.cs:line 241
   at Content.Server.StoreDiscount.Systems.StoreDiscountSystem.OnStoreInitialized(StoreInitializedEvent& ev) in /home/user/space-station-14/Content.Server/StoreDiscount/Systems/StoreDiscountSystem.cs:line 68
   at Robust.Shared.GameObjects.EntityEventBus.<>c__DisplayClass6_0`1.<SubscribeEvent>b__0(Unit& ev) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 195
   at Robust.Shared.GameObjects.EntityEventBus.ProcessSingleEventCore(EventSource source, Unit& unitRef, EventData subs) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 335
   at Robust.Shared.GameObjects.EntityEventBus.ProcessSingleEvent(EventSource source, Unit& unitRef, Type eventType) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 324
   at Robust.Shared.GameObjects.EntityEventBus.RaiseEvent[T](EventSource source, T& toRaise) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 283
   at Robust.Shared.GameObjects.EntitySystem.RaiseLocalEvent[T](T& message) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntitySystem.cs:line 105
   at Content.Server.Traitor.Uplink.UplinkSystem.SetUplink(EntityUid user, EntityUid uplink, FixedPoint2 balance, Boolean giveDiscounts) in /home/user/space-station-14/Content.Server/Traitor/Uplink/UplinkSystem.cs:line 78
   at Content.Server.Traitor.Uplink.UplinkSystem.AddUplink(EntityUid user, FixedPoint2 balance, Nullable`1 uplinkEntity, Boolean giveDiscounts) in /home/user/space-station-14/Content.Server/Traitor/Uplink/UplinkSystem.cs:line 51
   at Content.Server.GameTicking.Rules.TraitorRuleSystem.RequestUplink(EntityUid traitor, FixedPoint2 startingBalance, String briefing) in /home/user/space-station-14/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs:line 180
   at Content.Server.GameTicking.Rules.TraitorRuleSystem.MakeTraitor(EntityUid traitor, TraitorRuleComponent component) in /home/user/space-station-14/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs:line 121
   at Content.Server.GameTicking.Rules.TraitorRuleSystem.AfterEntitySelected(Entity`1 ent, AfterAntagEntitySelectedEvent& args) in /home/user/space-station-14/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs:line 59
   at Robust.Shared.GameObjects.EntityEventBus.<>c__DisplayClass57_0`2.<SubscribeLocalEvent>g__EventHandler|0(EntityUid uid, IComponent comp, TEvent& args) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 324
   at Robust.Shared.GameObjects.EntityEventBus.<>c__DisplayClass67_0`1.<EntSubscribe>b__0(EntityUid uid, IComponent comp, Unit& ev) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 460
   at Robust.Shared.GameObjects.EntityEventBus.EntDispatch(EntityUid euid, Type eventType, Unit& args) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 634
   at Robust.Shared.GameObjects.EntityEventBus.RaiseLocalEventCore(EntityUid uid, Unit& unitRef, Type type, Boolean broadcast) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 240
   at Robust.Shared.GameObjects.EntityEventBus.RaiseLocalEvent[TEvent](EntityUid uid, TEvent& args, Boolean broadcast) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 218
   at Robust.Shared.GameObjects.EntitySystem.RaiseLocalEvent[TEvent](EntityUid uid, TEvent& args, Boolean broadcast) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntitySystem.cs:line 170
   at Content.Server.Antag.AntagSelectionSystem.MakeAntag(Entity`1 ent, ICommonSession session, AntagSelectionDefinition def, Boolean ignoreSpawner) in /home/user/space-station-14/Content.Server/Antag/AntagSelectionSystem.cs:line 370
   at Content.Server.Antag.AntagSelectionSystem.ForceMakeAntag[T](ICommonSession player, String defaultRule) in /home/user/space-station-14/Content.Server/Antag/AntagSelectionSystem.API.cs:line 337
   at Content.Server.Administration.Systems.AdminVerbSystem.<>c__DisplayClass8_0.<AddAntagVerbs>b__0() in /home/user/space-station-14/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs:line 62
   at Content.Shared.Verbs.SharedVerbSystem.ExecuteVerb(Verb verb, EntityUid user, EntityUid target, Boolean forced) in /home/user/space-station-14/Content.Shared/Verbs/SharedVerbSystem.cs:line 159
   at Content.Server.Verbs.VerbSystem.ExecuteVerb(Verb verb, EntityUid user, EntityUid target, Boolean forced) in /home/user/space-station-14/Content.Server/Verbs/VerbSystem.cs:line 86
   at Content.Shared.Verbs.SharedVerbSystem.HandleExecuteVerb(ExecuteVerbEvent args, EntitySessionEventArgs eventArgs) in /home/user/space-station-14/Content.Shared/Verbs/SharedVerbSystem.cs:line 47
   at Robust.Shared.GameObjects.EventBusExt.HandlerWrapper`1.Invoke(EntitySessionMessage`1 msg) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EventBusExt.cs:line 46
   at Robust.Shared.GameObjects.EntityEventBus.<>c__DisplayClass4_0`1.<SubscribeEvent>b__0(Unit& ev) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 173
   at Robust.Shared.GameObjects.EntityEventBus.ProcessSingleEventCore(EventSource source, Unit& unitRef, EventData subs) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 335
   at Robust.Shared.GameObjects.EntityEventBus.ProcessSingleEvent(EventSource source, Unit& unitRef, Type eventType) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 324
   at Robust.Shared.GameObjects.EntityEventBus.RaiseEvent(EventSource source, Object toRaise) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 267
   at Robust.Server.GameObjects.ServerEntityManager.<Initialize>b__8_0(Object _, Object systemMsg) in /home/user/space-station-14/RobustToolbox/Robust.Server/GameObjects/ServerEntityManager.cs:line 53
   at Robust.Server.GameObjects.ServerEntityManager.DispatchEntityNetworkMessage(MsgEntity message) in /home/user/space-station-14/RobustToolbox/Robust.Server/GameObjects/ServerEntityManager.cs:line 266
   at Robust.Server.GameObjects.ServerEntityManager.TickUpdate(Single frameTime, Boolean noPredictions, Histogram histogram) in /home/user/space-station-14/RobustToolbox/Robust.Server/GameObjects/ServerEntityManager.cs:line 192
   at Robust.Server.BaseServer.Update(FrameEventArgs frameEventArgs) in /home/user/space-station-14/RobustToolbox/Robust.Server/BaseServer.cs:line 731
   at Robust.Server.BaseServer.<SetupMainLoop>b__67_1(Object sender, FrameEventArgs args) in /home/user/space-station-14/RobustToolbox/Robust.Server/BaseServer.cs:line 544
   at Robust.Shared.Timing.GameLoop.Run() in /home/user/space-station-14/RobustToolbox/Robust.Shared/Timing/GameLoop.cs:line 235
   at Robust.Server.BaseServer.MainLoop() in /home/user/space-station-14/RobustToolbox/Robust.Server/BaseServer.cs:line 571
   at Robust.Server.Program.ParsedMain(CommandLineArgs args, Boolean contentStart, ServerOptions options) in /home/user/space-station-14/RobustToolbox/Robust.Server/Program.cs:line 74
   at Robust.Server.Program.Start(String[] args, ServerOptions options, Boolean contentStart) in /home/user/space-station-14/RobustToolbox/Robust.Server/Program.cs:line 42
   at Robust.Server.ContentStart.Start(String[] args) in /home/user/space-station-14/RobustToolbox/Robust.Server/ContentStart.cs:line 10
   at Content.Server.Program.Main(String[] args) in /home/user/space-station-14/Content.Server/Program.cs:line 9
Unhandled exception. System.ArgumentException: An item with the same key has already been added. Key: usualDiscounts
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Content.Shared.Store.ListingDataWithCostModifiers.AddCostModifier(String modifierSourceId, Dictionary`2 modifiers) in /home/user/space-station-14/Content.Shared/Store/ListingPrototype.cs:line 324
   at Content.Server.StoreDiscount.Systems.StoreDiscountSystem.ApplyDiscounts(IReadOnlyList`1 listings, IReadOnlyCollection`1 discounts) in /home/user/space-station-14/Content.Server/StoreDiscount/Systems/StoreDiscountSystem.cs:line 241
   at Content.Server.StoreDiscount.Systems.StoreDiscountSystem.OnStoreInitialized(StoreInitializedEvent& ev) in /home/user/space-station-14/Content.Server/StoreDiscount/Systems/StoreDiscountSystem.cs:line 68
   at Robust.Shared.GameObjects.EntityEventBus.<>c__DisplayClass6_0`1.<SubscribeEvent>b__0(Unit& ev) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 195
   at Robust.Shared.GameObjects.EntityEventBus.ProcessSingleEventCore(EventSource source, Unit& unitRef, EventData subs) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 335
   at Robust.Shared.GameObjects.EntityEventBus.ProcessSingleEvent(EventSource source, Unit& unitRef, Type eventType) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 324
   at Robust.Shared.GameObjects.EntityEventBus.RaiseEvent[T](EventSource source, T& toRaise) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 283
   at Robust.Shared.GameObjects.EntitySystem.RaiseLocalEvent[T](T& message) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntitySystem.cs:line 105
   at Content.Server.Traitor.Uplink.UplinkSystem.SetUplink(EntityUid user, EntityUid uplink, FixedPoint2 balance, Boolean giveDiscounts) in /home/user/space-station-14/Content.Server/Traitor/Uplink/UplinkSystem.cs:line 78
   at Content.Server.Traitor.Uplink.UplinkSystem.AddUplink(EntityUid user, FixedPoint2 balance, Nullable`1 uplinkEntity, Boolean giveDiscounts) in /home/user/space-station-14/Content.Server/Traitor/Uplink/UplinkSystem.cs:line 51
   at Content.Server.GameTicking.Rules.TraitorRuleSystem.RequestUplink(EntityUid traitor, FixedPoint2 startingBalance, String briefing) in /home/user/space-station-14/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs:line 180
   at Content.Server.GameTicking.Rules.TraitorRuleSystem.MakeTraitor(EntityUid traitor, TraitorRuleComponent component) in /home/user/space-station-14/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs:line 121
   at Content.Server.GameTicking.Rules.TraitorRuleSystem.AfterEntitySelected(Entity`1 ent, AfterAntagEntitySelectedEvent& args) in /home/user/space-station-14/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs:line 59
   at Robust.Shared.GameObjects.EntityEventBus.<>c__DisplayClass57_0`2.<SubscribeLocalEvent>g__EventHandler|0(EntityUid uid, IComponent comp, TEvent& args) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 324
   at Robust.Shared.GameObjects.EntityEventBus.<>c__DisplayClass67_0`1.<EntSubscribe>b__0(EntityUid uid, IComponent comp, Unit& ev) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 460
   at Robust.Shared.GameObjects.EntityEventBus.EntDispatch(EntityUid euid, Type eventType, Unit& args) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 634
   at Robust.Shared.GameObjects.EntityEventBus.RaiseLocalEventCore(EntityUid uid, Unit& unitRef, Type type, Boolean broadcast) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 240
   at Robust.Shared.GameObjects.EntityEventBus.RaiseLocalEvent[TEvent](EntityUid uid, TEvent& args, Boolean broadcast) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Directed.cs:line 218
   at Robust.Shared.GameObjects.EntitySystem.RaiseLocalEvent[TEvent](EntityUid uid, TEvent& args, Boolean broadcast) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntitySystem.cs:line 170
   at Content.Server.Antag.AntagSelectionSystem.MakeAntag(Entity`1 ent, ICommonSession session, AntagSelectionDefinition def, Boolean ignoreSpawner) in /home/user/space-station-14/Content.Server/Antag/AntagSelectionSystem.cs:line 370
   at Content.Server.Antag.AntagSelectionSystem.ForceMakeAntag[T](ICommonSession player, String defaultRule) in /home/user/space-station-14/Content.Server/Antag/AntagSelectionSystem.API.cs:line 337
   at Content.Server.Administration.Systems.AdminVerbSystem.<>c__DisplayClass8_0.<AddAntagVerbs>b__0() in /home/user/space-station-14/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs:line 62
   at Content.Shared.Verbs.SharedVerbSystem.ExecuteVerb(Verb verb, EntityUid user, EntityUid target, Boolean forced) in /home/user/space-station-14/Content.Shared/Verbs/SharedVerbSystem.cs:line 159
   at Content.Server.Verbs.VerbSystem.ExecuteVerb(Verb verb, EntityUid user, EntityUid target, Boolean forced) in /home/user/space-station-14/Content.Server/Verbs/VerbSystem.cs:line 86
   at Content.Shared.Verbs.SharedVerbSystem.HandleExecuteVerb(ExecuteVerbEvent args, EntitySessionEventArgs eventArgs) in /home/user/space-station-14/Content.Shared/Verbs/SharedVerbSystem.cs:line 47
   at Robust.Shared.GameObjects.EventBusExt.HandlerWrapper`1.Invoke(EntitySessionMessage`1 msg) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EventBusExt.cs:line 46
   at Robust.Shared.GameObjects.EntityEventBus.<>c__DisplayClass4_0`1.<SubscribeEvent>b__0(Unit& ev) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 173
   at Robust.Shared.GameObjects.EntityEventBus.ProcessSingleEventCore(EventSource source, Unit& unitRef, EventData subs) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 335
   at Robust.Shared.GameObjects.EntityEventBus.ProcessSingleEvent(EventSource source, Unit& unitRef, Type eventType) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 324
   at Robust.Shared.GameObjects.EntityEventBus.RaiseEvent(EventSource source, Object toRaise) in /home/user/space-station-14/RobustToolbox/Robust.Shared/GameObjects/EntityEventBus.Broadcast.cs:line 267
   at Robust.Server.GameObjects.ServerEntityManager.<Initialize>b__8_0(Object _, Object systemMsg) in /home/user/space-station-14/RobustToolbox/Robust.Server/GameObjects/ServerEntityManager.cs:line 53
   at Robust.Server.GameObjects.ServerEntityManager.DispatchEntityNetworkMessage(MsgEntity message) in /home/user/space-station-14/RobustToolbox/Robust.Server/GameObjects/ServerEntityManager.cs:line 266
   at Robust.Server.GameObjects.ServerEntityManager.TickUpdate(Single frameTime, Boolean noPredictions, Histogram histogram) in /home/user/space-station-14/RobustToolbox/Robust.Server/GameObjects/ServerEntityManager.cs:line 192
   at Robust.Server.BaseServer.Update(FrameEventArgs frameEventArgs) in /home/user/space-station-14/RobustToolbox/Robust.Server/BaseServer.cs:line 731
   at Robust.Server.BaseServer.<SetupMainLoop>b__67_1(Object sender, FrameEventArgs args) in /home/user/space-station-14/RobustToolbox/Robust.Server/BaseServer.cs:line 544
   at Robust.Shared.Timing.GameLoop.Run() in /home/user/space-station-14/RobustToolbox/Robust.Shared/Timing/GameLoop.cs:line 235
   at Robust.Server.BaseServer.MainLoop() in /home/user/space-station-14/RobustToolbox/Robust.Server/BaseServer.cs:line 571
   at Robust.Server.Program.ParsedMain(CommandLineArgs args, Boolean contentStart, ServerOptions options) in /home/user/space-station-14/RobustToolbox/Robust.Server/Program.cs:line 74
   at Robust.Server.Program.Start(String[] args, ServerOptions options, Boolean contentStart) in /home/user/space-station-14/RobustToolbox/Robust.Server/Program.cs:line 42
   at Robust.Server.ContentStart.Start(String[] args) in /home/user/space-station-14/RobustToolbox/Robust.Server/ContentStart.cs:line 10
   at Content.Server.Program.Main(String[] args) in /home/user/space-station-14/Content.Server/Program.cs:line 9

Process finished with exit code 134.
@github-actions github-actions bot added the S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. label Dec 13, 2024
@Errant-4 Errant-4 added P3: Standard Priority: Default priority for repository items. D2: Medium Difficulty: A good amount of codebase knowledge required. Issue: Replicated This issue has been replicated by another user. and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D2: Medium Difficulty: A good amount of codebase knowledge required. Issue: Replicated This issue has been replicated by another user. P3: Standard Priority: Default priority for repository items.
Projects
None yet
Development

No branches or pull requests

1 participant