Skip to content

Commit 351ded8

Browse files
committed
Revert "Physics only sends pitch/yaw if they changed"
This reverts commit 447d296. This is a pointless comparison, server doesn't complain when we send Position and Look and we'll spend a longer time calculating this than we gain in the marginal improvement to serverbound traffic (which is already minimal) - nickelpro
1 parent 2bce26e commit 351ded8

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

spockbot/plugins/helpers/physics.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def __init__(self, ploader, settings):
8282
self.world, BoundingBox(const.PLAYER_WIDTH, const.PLAYER_HEIGHT)
8383
)
8484
self.pos = self.clientinfo.position
85-
self.prev_dict = None
8685
self.skip_tick = False
8786
self.pc = PhysicsCore(self.pos, self.vec, self.clientinfo.abilities)
8887
ploader.provides('Physics', self.pc)
@@ -99,13 +98,8 @@ def resume_physics(self, _=None, __=None):
9998
self.event.reg_event_handler('physics_tick', self.physics_tick)
10099

101100
def client_tick(self, name, data):
102-
current_dict = self.clientinfo.position.get_dict()
103-
if self.prev_dict and self.prev_dict['yaw'] == current_dict['yaw'] \
104-
and self.prev_dict['pitch'] == current_dict['pitch']:
105-
self.net.push_packet('PLAY>Player Position', current_dict)
106-
else:
107-
self.net.push_packet('PLAY>Player Position and Look', current_dict)
108-
self.prev_dict = current_dict
101+
self.net.push_packet('PLAY>Player Position and Look',
102+
self.clientinfo.position.get_dict())
109103

110104
def physics_tick(self, _, __):
111105
if self.skip_tick:

0 commit comments

Comments
 (0)