fix: spellbooks can have infinite charges (#38376)

* fix: spellbooks can have infinite charges

* refactor: indicate infinite spellbook charges with null

Not sure if I like this much better...
This commit is contained in:
Perry Fraser
2025-07-05 02:28:56 -04:00
committed by GitHub
parent 78e8d98137
commit 6cefc412a3
3 changed files with 20 additions and 15 deletions

View File

@@ -16,12 +16,14 @@ public sealed partial class SpellbookComponent : Component
[ViewVariables]
public readonly List<EntityUid> Spells = new();
// The three fields below are just used for initialization.
/// <summary>
/// The three fields below is just used for initialization.
/// Dictionary of spell prototypes to charge counts.
/// If the charge count is null, it means the spell has infinite charges.
/// </summary>
[DataField]
[ViewVariables(VVAccess.ReadWrite)]
public Dictionary<EntProtoId, int> SpellActions = new();
public Dictionary<EntProtoId, int?> SpellActions = new();
[DataField]
[ViewVariables(VVAccess.ReadWrite)]