Skip to content

Commit

Permalink
Revert "Physics only sends pitch/yaw if they changed"
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Gjum committed Jan 10, 2016
1 parent 2bce26e commit 351ded8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions spockbot/plugins/helpers/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def __init__(self, ploader, settings):
self.world, BoundingBox(const.PLAYER_WIDTH, const.PLAYER_HEIGHT)
)
self.pos = self.clientinfo.position
self.prev_dict = None
self.skip_tick = False
self.pc = PhysicsCore(self.pos, self.vec, self.clientinfo.abilities)
ploader.provides('Physics', self.pc)
Expand All @@ -99,13 +98,8 @@ def resume_physics(self, _=None, __=None):
self.event.reg_event_handler('physics_tick', self.physics_tick)

def client_tick(self, name, data):
current_dict = self.clientinfo.position.get_dict()
if self.prev_dict and self.prev_dict['yaw'] == current_dict['yaw'] \
and self.prev_dict['pitch'] == current_dict['pitch']:
self.net.push_packet('PLAY>Player Position', current_dict)
else:
self.net.push_packet('PLAY>Player Position and Look', current_dict)
self.prev_dict = current_dict
self.net.push_packet('PLAY>Player Position and Look',
self.clientinfo.position.get_dict())

def physics_tick(self, _, __):
if self.skip_tick:
Expand Down

0 comments on commit 351ded8

Please sign in to comment.