Aleph-One-Marathon / alephone

Aleph One is the open source continuation of Bungie’s Marathon 2 game engine.
https://alephone.lhowon.org/
GNU General Public License v3.0
621 stars 100 forks source link

M2 Basic HUD bugs (Lua errors in netgame with "Kill limit" enabled; incorrect 'time' score displays in KTMWTB and Tag) #494

Closed bangstk closed 1 month ago

bangstk commented 1 month ago

The "Lua errors in Netgame with Kill Limit" issue was fixed for the M1 Basic HUD (fbffbfb) but the same fix was not done for the M2 version.

Additionally, all of the the M2 and M1 Basic HUDs (and the Default Lua HUD it is derived from) and the M1 Default Lua huds display the per-player 'time score' in the Network Statistics HUD scoreboard improperly (modes such as KTMWTB and Tag).

Essentially, the 'ranking' score for time score gamemodes is assumed to be in seconds but it is actually in tics (1/30 of a second) so the math for printing them needs to be adjusted in the Lua huds, as well as drawing it properly when the score is negative (Tag)

Basic (Built-in) HUD does not have this issue.

The time score issue can be fixed by changing the bottom return line in player_ranking_text() in the Lua huds from return string.format("%d:%02d", math.floor(ranking/60), ranking % 60) to return string.format("%d:%02d", math.floor(math.abs(ranking/30/60) ), math.abs(ranking/30) % 60)