mWalrus / MapRank

A trackmania plugin which shows your world rank on the current map
https://openplanet.dev/plugin/maprank
MIT License
1 stars 0 forks source link

Divide by zero crash #5

Closed Protoster closed 1 year ago

Protoster commented 1 year ago

I noticed that the widget appeared to be stuck on "Fetching leaderboard info...", and would not come back even after changing maps. Reloading the plugin fixed it.

These messages from the log may be relevant:

[   ScriptRuntime] [21:30:27] [MapRank]  Fetched total player count: 0
[   ScriptRuntime] [21:30:27] [MapRank]  DEPRECATED: For the Live API, you should use NadeoServices::BaseURLLive() instead of BaseURL().
[   ScriptRuntime] [21:30:27] [MapRank]  Fetched player's leaderboard position: 7405
[   ScriptRuntime] [21:30:27] [MapRank]  Script exception: Divide by zero
[   ScriptRuntime] [21:30:27] [MapRank]    MapRank.op/:/main.as (line 132, column 2)
[   ScriptRuntime] [21:30:27] [MapRank]      #0  float CalcPositionPercentage(const int&in pos, const uint&in total) (MapRank.op/:/main.as line 132)
[   ScriptRuntime] [21:30:27] [MapRank]      #1  void GetLeaderboardInfo(CGameCtnChallenge@&in map, CTrackManiaNetwork@&in network) (MapRank.op/:/main.as line 101)
[   ScriptRuntime] [21:30:27] [MapRank]      #2  void Main() (MapRank.op/:/main.as line 74)
mWalrus commented 1 year ago

Hi, I don't know how I missed both your issues for over a month but thanks for the reports! :) I'll look into both of them and release an update ASAP

mWalrus commented 1 year ago

This should now be fixed in v1.2.2 :)

It will take a while for the updated version to get signed and uploaded to openplanet.