diff --git a/KAIN2/Game/PHYSOBS.C b/KAIN2/Game/PHYSOBS.C index b3923f3d..c18a5fab 100644 --- a/KAIN2/Game/PHYSOBS.C +++ b/KAIN2/Game/PHYSOBS.C @@ -2996,34 +2996,63 @@ void PHYSOBS_SetNewAnim(struct _Instance* instance, struct PhysObData* Data, uns } -// autogenerated function stub: -// long /*$ra*/ PHYSOB_CheckForEnemyInBlkSpot(struct _Instance *instance /*$a0*/, int dx /*$a1*/, int dy /*$a2*/) -long PHYSOB_CheckForEnemyInBlkSpot(struct _Instance *instance, int dx, int dy) -{ // line 4623, offset 0x8006ede0 - /* begin block 1 */ - // Start line: 4624 - // Start offset: 0x8006EDE0 - // Variables: - int x; // $v0 - int y; // $v1 - int z; // $v0 - int x0; // $s6 - int x1; // $s5 - int y0; // $s4 - int y1; // $s3 - int z0; // $s2 - int z1; // $s1 - struct _Instance *inst; // $s0 - /* end block 1 */ - // End offset: 0x8006EEEC - // End Line: 4646 +long PHYSOB_CheckForEnemyInBlkSpot(struct _Instance *instance, int dx, int dy) // Matching 100% +{ + + int x; + int x0; + int x1; + + int y; + int y0; + int y1; + + int z; + int z0; + int z1; + + struct _Instance *inst; + int maxDistance; + + maxDistance = 0x140; + inst = gameTrackerX.instanceList->first; + + x = instance->position.x + dx; + y = instance->position.y + dy; + z = instance->position.z; + + x0 = x - maxDistance; + x1 = x + maxDistance; + + y0 = y - maxDistance; + y1 = y + maxDistance; + + z0 = z - maxDistance; + z1 = z + maxDistance; + + while (inst != NULL) + { + + if (!(inst->object->oflags2 & 0x80000) || + inst->flags2 & 0x08000000 || + INSTANCE_Query(inst, 0) & 0x40000000 || + inst->position.x < x0 || + x1 < inst->position.x || + inst->position.y < y0 || + y1 < inst->position.y || + inst->position.z < z0 || + z1 < inst->position.z) + { - /* begin block 2 */ - // Start line: 10217 - /* end block 2 */ - // End Line: 10218 - UNIMPLEMENTED(); - return 0; + inst = inst->next; + + } + else + { + return 1; + } + } + return 0; }