|
55 | 55 | from memory import get_object_pointer |
56 | 56 | from memory import make_object |
57 | 57 | # Players |
| 58 | +from _players import PlayerMixin |
58 | 59 | from players.constants import PlayerStates |
59 | 60 | from players.helpers import address_from_playerinfo |
60 | 61 | from players.helpers import get_client_language |
|
73 | 74 | # ============================================================================= |
74 | 75 | # >> CLASSES |
75 | 76 | # ============================================================================= |
76 | | -class Player(Entity): |
| 77 | +class Player(Entity, PlayerMixin): |
77 | 78 | """Class used to interact directly with players.""" |
78 | 79 |
|
79 | 80 | def __init__(self, index): |
@@ -380,33 +381,12 @@ def set_eye_location(self, eye_location): |
380 | 381 |
|
381 | 382 | eye_location = property(Entity.get_eye_location, set_eye_location) |
382 | 383 |
|
383 | | - @property |
384 | | - def view_vector(self): |
385 | | - """Return the view vector of the player. |
386 | | -
|
387 | | - :rtype: Vector |
388 | | - """ |
389 | | - eye_angle = self.eye_angle |
390 | | - |
391 | | - yaw = math.radians(eye_angle.y) |
392 | | - pitch = math.radians(eye_angle.x) |
393 | | - |
394 | | - sy = math.sin(yaw) |
395 | | - cy = math.cos(yaw) |
396 | | - sp = math.sin(pitch) |
397 | | - cp = math.cos(pitch) |
398 | | - |
399 | | - return Vector(cp * cy, cp * sy, -sp) |
400 | | - |
401 | 384 | def get_view_angle(self): |
402 | 385 | """Return the player's view angle. |
403 | 386 |
|
404 | 387 | :rtype: QAngle |
405 | 388 | """ |
406 | | - eye_angle = self.eye_angle |
407 | | - eye_angle_y = eye_angle.y |
408 | | - eye_angle_y = (eye_angle_y + 360) if eye_angle_y < 0 else eye_angle_y |
409 | | - return QAngle(eye_angle.x, eye_angle_y, self.rotation.z) |
| 389 | + return super().view_angle |
410 | 390 |
|
411 | 391 | def set_view_angle(self, angle): |
412 | 392 | """Set the player's view angle.""" |
|
0 commit comments