#include "game_types.h"

/* Sub_080047D8 @ 0x080047D8 (real 34B) -- clamps v to [-4096,4096], stores halfword at +166. Mirrors src/matched/Sub_080047D8.c. */
/* Clamps v to [-4096, 4096] (pool word 0xFFFFF000 = -4096) and stores it as
   the halfword at byte offset 166. */
void Sub_080047D8(char *p, int v)
{
    if (v < -4096)
        v = -4096;
    else if (v > 4096)
        v = 4096;
    *(short *)(p + 166) = (short)v;
}
