document reuse of variables in link mode

This commit is contained in:
Kurausukun 2020-12-14 21:41:30 -05:00
parent 58976ebaa8
commit 6faa63347a

View File

@ -2908,6 +2908,9 @@ static void ZeroObjectEvent(struct ObjectEvent *objEvent)
memset(objEvent, 0, sizeof(struct ObjectEvent));
}
// Note: Emerald reuses the direction and range variables during Link mode
// as special gender and direction values. The types and placement
// conflict with the usual Event Object struct, thus the definitions.
#define linkGender(obj) obj->singleMovementActive
// not even one can reference *byte* aligned bitfield members...
#define linkDirection(obj) ((u8*)obj)[offsetof(typeof(*obj), fieldEffectSpriteId) - 1] // -> rangeX