Skip to content

Commit

Permalink
v2
Browse files Browse the repository at this point in the history
  • Loading branch information
agenda-shaper committed Aug 6, 2023
1 parent 2200c50 commit dcee834
Show file tree
Hide file tree
Showing 20 changed files with 1,021 additions and 749 deletions.
13 changes: 10 additions & 3 deletions Assets/Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Car getCarById(int id) {
if (this.carDict.TryGetValue(id, out Car car)) {
return car;
} else {
Debug.Log("Car with id " + id + " not found in car dictionary");
Debug.LogError("Car with id " + id + " not found in car dictionary");
return null;
}
}
Expand Down Expand Up @@ -179,12 +179,16 @@ void FixedUpdate() {
for (int i = 0; i < num_cars; i++) {

float CarID = GameTickPacket[i * 16 + 15];
if (float.IsNaN(CarID) || float.IsInfinity(CarID) || CarID <= 0) {

if (float.IsNaN(CarID) || float.IsInfinity(CarID) || CarID <= 0 || CarID != Math.Round(CarID)) {
//Debug.Log(CarID);
//Debug.Log(string.Join(", ", GameTickPacket)); // first frame uninitialized GameTickPacket prob because of 120tps timing in the cpp engine
return;
}
Car car = arena.getCarById((int)GameTickPacket[i * 16 + 15]);
Debug.Log("Getting car by id: ");
Debug.Log(CarID);

Car car = arena.getCarById((int)CarID);
Vector3 carPos = new Vector3(GameTickPacket[i * 16 + 1], GameTickPacket[i * 16 + 2], GameTickPacket[i * 16]);
car.gameObject.transform.position = carPos;

Expand Down Expand Up @@ -214,6 +218,9 @@ void FixedUpdate() {
//GameTickPacket[i * 16 + 14] = static_cast<float>(Car->team);
}

Debug.Log("Getting car by id from arena instance: ");
Debug.Log(arena.mainCarId);


Car mainCar = arena.getCarById(arena.mainCarId);

Expand Down
Binary file modified Assets/LiteLeague.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Assets/LiteLeague.dll.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions Assets/octane_-_rocket_league_car.obj.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dcee834

Please sign in to comment.