void stalking(void) // could optimize a little more
{
unsigned int g_raceCondition = GetRaceCondition(), g_racePointer = GetRacePointer(), tempActive = 0;
static unsigned int pointer = 0, active = 0, player = 1;
float dataY = 0, dataZ = 0;
static bool held = false;
if (g_raceCondition != 1)
{
player = 1;
active = 0;
pointer = 0;
return;
}
if (g_raceCondition == 1)
{
if (!is_pressed(Y))
{
held = false;
}
if (is_pressed(Y))
{
tempActive = 1;
if (is_pressed(DU))
{
active = 1;
}
if (is_pressed(DD))
{
active = 0;
player = 1;
}
if (!held)
{
if (is_pressed(DR))
{
held = true;
player++;
}
if (is_pressed(DL))
{
held = true;
player--;
}
}
}
if (active == 1 || tempActive == 1)
{
if (player > 8 || player < 1)
{
player = 1;
return;
}
pointer = 0x209C + READU32(0x65DA44) + (player * 0x44);
if (READU32(pointer) < 0x14000000 || READU32(pointer) > 0x18000000 || READU32(pointer) == g_racePointer || READU32(READU32(pointer) + 0x24) < 0x30000000 || READU32(READU32(pointer) + 0x24) > 0xD0000000 || READU32(READU32(pointer) + 0x2C) < 0x30000000 || READU32(READU32(pointer) + 0x2C) > 0xD0000000)
{
player++;
return;
}
if (player > 0 && player < 9 && READU32(pointer) > 0x14000000 && READU32(pointer) < 0x18000000 && g_racePointer > 0x14000000 && g_racePointer < 0x18000000)
{
dataY = READFLOAT(READU32(pointer) + 0x28);
dataY += 38;
dataZ = READFLOAT(READU32(pointer) + 0x2C);
if (dataY != 0 && dataY != 38 && dataZ != 0)
{
memcpy((void *)(g_racePointer), (void*)(READU32(pointer)), 0x28);
WRITEFLOAT(g_racePointer + 0x28, dataY);
WRITEFLOAT(g_racePointer + 0x2C, dataZ);
}
else
{
player++;
}
}
}
}
}