1. Shadow 7

    Shadow 7 Naked Wanderer

    Hi there.
    Then I try to get float value from config I getting this error:
    InvalidCastException: Cannot cast from source type to destination type.
    Code (Text):
    CraftTimeDecreasePerLevel = (float) Config["CraftDecrease"];
    That happens only to float values.
    Thanks in advance.
     
  2. Hatemail

    Hatemail Plugin Developer

    Config.Get<float>("CraftDecrease");
     
    Shadow 7 likes this.
  3. Shadow 7

    Shadow 7 Naked Wanderer

    Thanks! But really, what is wrong with that cast?
     
  4. Hatemail

    Hatemail Plugin Developer

    If you did: float floatN =(float) (int) ConfigVariable; it would of worked too. Atleast if it was represented internally as an int.

    I don't have the time to explain how cast works from a mobile phone so that is my simple explanation.
     
    Shadow 7 likes this.
  5. Shadow 7

    Shadow 7 Naked Wanderer

    Thanks!)
     
  6. Deicide666ra

    Deicide666ra Plugin Developer

    Wouldn't that strip the digits?