Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mod_autoAimOptimize.py #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .deprecated/mod_autoAimOptimize/source/mod_autoAimOptimize.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import math

import Math

import BigWorld
import CommandMapping
import Math
from Avatar import PlayerAvatar
from AvatarInputHandler import cameras, control_modes
from gui.app_loader import g_appLoader
from gui.shared.personality import ServicesLocator

from gui.mods.mod_mods_gui import g_gui, inject
# Fixed to Wot 1.11.0.0


class Config(object):
Expand Down Expand Up @@ -95,7 +96,7 @@ def catch(self):
if vData['team'] != self.player.team and vData['isAlive']:
vehicle = BigWorld.entity(vId)
if vehicle is not None and vehicle.isStarted and vehicle.isAlive():
radian = self.calc_radian(vehicle.position, self.angle) # 1.289 градуса в радианах
radian = self.calc_radian(vehicle.position, self.angle) # 1.289
if radian:
length = Math.Vector3(vehicle.position - playerPosition).length
if result_len is None:
Expand All @@ -112,7 +113,6 @@ def catch(self):
return result if result is not None else None
return

# рассчёт угла видимости от камеры до противника
@staticmethod
def calc_radian(target_position, angle):
cameraDir, cameraPos = cameras.getWorldRayAndPoint(0, 0)
Expand All @@ -128,7 +128,8 @@ def calc_radian(target_position, angle):
@inject.log
def injectButton(self, isDown, key):
if config.data['enabled'] and self.player is not None:
if g_appLoader.getDefBattleApp():
battle = ServicesLocator.appLoader.getDefBattleApp() # update
if battle:
if CommandMapping.g_instance.isFired(CommandMapping.CMD_CM_LOCK_TARGET, key) and isDown:
return self.catch()
return
Expand Down