From 54267e73410358834c534cc6335463b2186129cb Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Fri, 4 Oct 2024 07:05:19 -0700 Subject: [PATCH] add warning about union data structures --- docs/gui/gm-editor.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/gui/gm-editor.rst b/docs/gui/gm-editor.rst index 50ff88e14..e2a34a488 100644 --- a/docs/gui/gm-editor.rst +++ b/docs/gui/gm-editor.rst @@ -29,6 +29,16 @@ realtime, hit :kbd:`Alt`:kbd:`A` to switch to auto update mode. your game before poking around in `gui/gm-editor`, especially if you are examining data while the game is unpaused. +.. warning:: + + Union data structures contain fields that occupy the same memory space. + When you see the ``[union structure]`` badge at the top of the screen, be + aware that only one of the fields in the structure is likely to make sense. + The "correct" field is usually indicated by some context in the parent + structure. If there are any pointers to substructures in the union, + inspecting the pointer when it is not the "correct" field may crash the + game. + Usage -----