IGame.WriteToConsole() will throw exception when trying to print enum values

Here you can find all solved gameplay problems and bugs (beginning from Pre-Alpha 1.8.8).
Forum rules
By using the forum you agree to the following rules. For this forum you also need to follow these additional rules.
Locked
NearHuscarl
Superfighter
Superfighter
Posts: 97
Joined: Thu Feb 07, 2019 4:36 am

IGame.WriteToConsole() will throw exception when trying to print enum values

Post by NearHuscarl » Wed Mar 25, 2020 7:45 am

You should be able to print out enum values without having to call ToString(). Code to reproduce:

Code: Select all

enum E { One, Two, Three }

public void OnStartup()
{
	Game.WriteToConsole(E.One); // not working
	Game.WriteToConsole(E.One.ToString()); // works
}
0 x
Image

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Fri Mar 27, 2020 8:11 pm

Fixed after v.1.3.5:
Removed IGame.WriteToConsole(string text) in favor for the new IGame.WriteToConsole(object param[] args) to avoid ambiguous calls between the two.
0 x
Gurt

Locked