How to recover a corrupt C++ project

My project had a structure in it FBattleStats; I realised that pointers to structs had limitations, so modified it to be a class UBattleStats (as well as changing the usage where required). The compiler complained that ‘BattleStats’ conflicted with a class name, so I restored everything to the original state, but the code will now still not build. Even removing BattleStats.h and cpp (and all references to them and the struct) from the VS project. cleaning and rebuilding gives the same result - I cannot compile.

Try to just delete the Source folder (eventually, make a backup first) in your project’s directory, then close the Editor, right click on the [yourProject].uproject and select “Generate Visual Studio project files”.

Now open again the editor, and add the BattleStats class from the editor following this guide: https://docs.unrealengine.com/latest/INT/Programming/QuickStart/2/

You can ereditate from Object (UObject) for that kind of data-driven class (choose it checking “show all classes” and then choose “Object” from the list).

Good luck,
spiez