Ara
Download

Search or run a command

Jump to a section or open an Ara link.

Diagnostic code · ARA0100

Mutable static state

A gameplay module stores mutable state in a static field or auto-property. Statics are outside ECS save, replay and replication, and their lifetime does not follow gameplay state. The edit is rejected; the last good code keeps running.

Common causes

  • A non-constant static field is not readonly.
  • A static auto-property has a setter.

Fixes

  • Move authoritative shared state into a [Resource] struct, or per-entity state into a [Component] struct.

  • Use const or static readonly only for genuinely immutable data; a readonly reference to mutable gameplay data does not make that state safe.

  • Code: ARA0100

  • Constant: cs::MUTABLE_STATIC

  • Reported by: Ara.Analyzers