veldtech / miki-bot

Miki Discord Bot
https://miki.bot
148 stars 49 forks source link

Lerp in the >calc command doesn't cast correctly #724

Closed cheese3660 closed 3 years ago

cheese3660 commented 3 years ago

Describe the bug When using the lerp function in the calc command with 3 integers passed as arguments it returns an error rather than casting the integers to doubles and evaluating from there

To Reproduce Steps to reproduce the behavior:

  1. Go to a discord server w/ this bot in it
  2. Type the command ">calc lerp(1,2,3)" or w/ any other combination of integers as arguments
  3. Send the message
  4. This error then appears: "Your calculation threw an error: Unable to cast object of type 'System.Int32' to type 'System.Double'."

Expected behavior For the correct result of the lerp function to be returned as if the arguments were doubles instead of integers, in the case of lerp(1,2,3) that would be 4

Screenshots Error Error Expected Behaviour Expected behaviour

cheese3660 commented 3 years ago

Also, this bug should still happen if even only one argument is an integer, as it casts the same way for all 3 arguments

velddev commented 3 years ago

Thanks for the bug report! I'm fairly certain you're the only person who has ever used the lerp function hahahha