Skip to content

Commit

Permalink
added lerp to utils and fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
99oblivius committed Sep 28, 2024
1 parent c008e1a commit 642a890
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/matches/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
import numpy as np

from config import BASE_MMR_CHANGE, STARTING_MMR
from utils.models import MMBotMaps, MMBotUserMapPicks, Side, MMBotUserMatchStats
from utils.models import MMBotMaps, MMBotUserMapPicks, Side
from utils.utils import lerp


def get_preferred_bans(maps: List[MMBotMaps], bans: List[str], total_bans: int=2) -> List[str]:
Expand Down
2 changes: 1 addition & 1 deletion src/matches/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ async def finalize_match(self, users_summary_data, team_scores, last_reply: dict
new_mmr = await calculate_placements_mmr(user_avg_score, guild_avg_scores, mmr)
users_placement_summary[member.id] = { 'mmr': new_mmr }
asyncio.create_task(self.send_placements_reward_message(member, new_mmr))
log.info(f"User {player.user_id} has completed their placements and received {placements_reward} mmr")
log.info(f"User {player.user_id} has completed their placements and received {new_mmr - mmr} mmr")
if users_placement_summary:
await self.bot.store.set_users_summary_stats(self.guild_id, users_placement_summary)

Expand Down
2 changes: 2 additions & 0 deletions src/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
from utils.models import MMBotMatchPlayers, MMBotRanks, MMBotMatches, MMBotUserMatchStats, Side, MMBotQueueUsers
from utils.logger import Logger as log

def lerp(a, b, t) -> float:
return a + (b - a) * t

def format_duration(seconds, short: bool=False):
intervals = (
Expand Down

0 comments on commit 642a890

Please sign in to comment.