wxyz-abcd / node-haxball

The most powerful and lightweight API that allows you to develop your original Haxball(www.haxball.com) host, client, and standalone applications both on node.js and browser environments and also includes every possible hack and functionality that you can imagine.
MIT License
34 stars 13 forks source link

Some events occur multiple times #28

Closed wxyz-abcd closed 1 year ago

wxyz-abcd commented 1 year ago

These events all happen inside game loop and they occur around 3-10 times whenever they are trying to occur only once.

wxyz-abcd commented 1 year ago

Event logic happens in 2 different places. The first is T.C(1), where the original physics engine is running one step at a time. The second one is inside Sf function, the extrapolation logic. The solution was to filter the extrapolated object, and use only the original object. Basro created lots of callbacks for this. I commented them out before, but now I see that the solution was in front of me the whole time. Events are running perfectly now.