further changes to show rtv boost correctly and display in percentage

This commit is contained in:
jenz 2023-09-12 21:20:34 +02:00
parent 8bbb937f6f
commit 048054d216
2 changed files with 7 additions and 2 deletions

View File

@ -17,3 +17,8 @@ native int GetAveragePlayerTimeOnServerRTV();
* @returns the players worth in connected hours for the rtv
*/
native int GetPlayerWorthRTV_(int client);
/**
* @returns the players rtv amount boost
*/
native float GetPlayerWorthRTV_boost_(int client);

View File

@ -224,7 +224,7 @@ public int Native_GetPlayerWorthRTV(Handle plugin, int numParams)
ThrowNativeError(SP_ERROR_NATIVE, "Client is not in-game.");
return -1;
}
return GetPlayerWorthRTV(client);
return view_as<int>(GetPlayerWorthRTV(client));
}
public int GetPlayerWorthRTV(int client)
@ -240,7 +240,7 @@ public int GetPlayerWorthRTV(int client)
g_fPlayerRTVWorth[client] = float(g_iPlayerRTVCapacity);
return avg * g_iPlayerRTVCapacity;
}
g_fPlayerRTVWorth[client] = float(g_iPlayerTimeServer[client] / avg);
g_fPlayerRTVWorth[client] = float(g_iPlayerTimeServer[client]) / float(avg);
return avg * (g_iPlayerTimeServer[client] / avg);
}