#include "game_types.h"

/* Collision_HasResult @ 0x08017830 (real 50B) -- hash-query hit test, boolean-normalized. Mirrors src/matched/Collision_HasResult.c. */
/* Runs the 6-arg spatial hash query over the target's bucket and normalizes
   the hit to 0/1. NULL target yields 0. */
extern int Spatial_HashQuery(int bucket, void *cb, int n, int x, void *mk, int *q);
extern void List_Alloc7(void);
extern void List_CreateEmpty(void);

int Collision_HasResult(int *q)
{
    int r;
    if (q == 0) {
        r = 0;
    } else {
        int *t = (int *)q[1];
        r = Spatial_HashQuery(t[1], List_Alloc7, 1,
                              *(short *)t + (int)q, List_CreateEmpty, q);
    }
    return r != 0;
}
