static void __stdcall DoTargetedCommand_Hook(int x, int y, Unit *target, int fow_unit) { x &= 0xffff; y &= 0xffff; fow_unit &= 0xffff; DoTargetedCommand(x, y, target, fow_unit); }
void __fastcall GameScreenLClickEvent_Targeting(Event *event) { if (IsOutsideGameScreen(event->x, event->y)) return; int x = event->x + *bw::screen_x; int y = event->y + *bw::screen_y; Unit *target = FindUnitAtPoint(x, y); Sprite *fow; if (!target) fow = ShowCommandResponse(x, y, 0); else fow = ShowCommandResponse(x, y, target->sprite); if (fow) DoTargetedCommand(x, y, target, fow->index); else DoTargetedCommand(x, y, target, Unit::None); SetCursorSprite(0); }