#include "game_types.h"

/* Collectible_Animate @ 0x08000F68 (real 44B) -- animate entry with conditional free. Mirrors src/matched/Collectible_Animate.c. */
/* Tags word 14, updates sub-positions at +60, retags, and frees when flag
   bit 0 is set. */
extern void UpdateSubPositions(int *p, int mode);
extern void Mem_FreeAndChildren(int *p);

void Collectible_Animate(int *p, int a)
{
    p[14] = 0x02000950;
    UpdateSubPositions(p + 15, 2);
    p[14] = 0x02000960;
    if ((a & 1) != 0)
        Mem_FreeAndChildren(p);
}
