File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ def get_output(self, packet: flat.GameTickPacket) -> flat.ControllerState:
9797 return self .controller
9898
9999 if self .state_setting :
100- self .test_state_setting (packet . balls [ 0 ]. physics . velocity )
100+ self .test_state_setting (packet )
101101
102102 if self .match_comms :
103103 # Limit packet spam
@@ -119,15 +119,27 @@ def get_output(self, packet: flat.GameTickPacket) -> flat.ControllerState:
119119
120120 return self .controller
121121
122- def test_state_setting (self , ball_velocity : flat .Vector3 ):
122+ def test_state_setting (self , packet : flat .GameTickPacket ):
123123 game_state = flat .DesiredGameState (
124124 [
125125 flat .DesiredBallState (
126126 flat .DesiredPhysics (
127- velocity = flat .Vector3Partial (z = ball_velocity .z + 10 )
127+ velocity = flat .Vector3Partial (
128+ z = packet .balls [0 ].physics .velocity .z + 10
129+ )
128130 )
129131 )
130- ]
132+ ],
133+ [
134+ flat .DesiredCarState (
135+ flat .DesiredPhysics (
136+ velocity = flat .Vector3Partial (
137+ z = packet .players [i ].physics .velocity .z + 1
138+ )
139+ )
140+ )
141+ for i in range (len (packet .players ))
142+ ],
131143 )
132144 self .set_game_state (game_state )
133145
You can’t perform that action at this time.
0 commit comments