UID261976性别保密经验 EP铁粒 粒回帖0主题精华在线时间 小时注册时间2022-2-2最后登录1970-1-1
|
发表于 2023-8-23 20:40:43 来自手机|显示全部楼层 IP:广东省
厉害LocalPlayer* localPlayer = Game.getLocalPlayer();
Vec3 origin = Game.getClientInstance()->levelRenderer->getOrigin();
//Loop through all our players and retrieve their information
targetList.clear();
Game.forEachEntity(findAimEntity);
if (targetList.size() > 0) {
std::sort(targetList.begin(), targetList.end(), CompareTargetEnArray());
Vec2 angle = origin.CalcAngle(*targetList[0]->getPos());
clientMessageF(std::to_string(angle.x + angle.y).c_str());
Vec2 appl = angle.sub(localPlayer->viewAngles).normAngles();
appl.x = -appl.x;
if ((appl.x < verticalrange && appl.x > -verticalrange) && (appl.y < horizontalrange && appl.y > -horizontalrange) && GameData::canUseMoveKeys()) {
PlayerInventoryProxy* supplies = Game.getLocalPlayer()->getSupplies();
ItemStack* item = supplies->inventory->getItemStack(supplies->selectedHotbarSlot);
if (sword && !(item->getItem()->isWeapon()))
return;
if (click && !Game.isLeftClickDown())
return;
if (!lock) {
appl.x /= (100.f - verticalspeed);
appl.y /= (100.f - horizontalspeed);
if (appl.x >= 1 || appl.x <= -1) appl.div(abs(appl.x));
if (appl.y >= 1 || appl.y <= -1) appl.div(abs(appl.y));
}
if (!vertical)
appl.x = 0;
localPlayer->applyTurnDelta(&appl);
}
} |
|