C
C#3w ago
MagicJinn

ILSpy decompiles namespaces incorrectly

I'm having an issue where ILSpy is decompiling scripts like this:
namespace Sunless.Game.AI;

public class HuntingPlus : AIBehaviour{ code here }
namespace Sunless.Game.AI;

public class HuntingPlus : AIBehaviour{ code here }
Instead of
namespace Sunless.Game.AI
{
public class HuntingPlus : AIBehaviour{ code here }
}
namespace Sunless.Game.AI
{
public class HuntingPlus : AIBehaviour{ code here }
}
Which is a big issue for the around 1000+ scripts it generates. I cannot fix it all manually. Did I configure something wrong?
15 Replies
canton7
canton73w ago
So it literally contains the text "namespace namespace"?
ero
ero3w ago
they're confused about file-scoped vs block scoped.
canton7
canton73w ago
I'd agree, if the first line wasn't namespace namespace Sunless.Game.AI;, with "namespace" repeated twice If ILSpy is really outputting that, that's obviously a problem If it's actually namespace Sunless.Game.AI; then sure, it's just OP's confusion
MagicJinn
MagicJinnOP3w ago
Nope, that was my mistake, sorry The problem is that Unity does not accept these files.
MagicJinn
MagicJinnOP3w ago
999+ errors
No description
ero
ero3w ago
but also what are you doing?
No description
ero
ero3w ago
why are you decompiling these files and putting them into a unity project?
MagicJinn
MagicJinnOP3w ago
Ah, was looking for that, thanks! Recreating a Unity project from an existing game.
ero
ero3w ago
for what purpose?
MagicJinn
MagicJinnOP3w ago
Remastering Well, fan remaster, I didn't make the game.
Jimmacle
Jimmacle3w ago
you'll need to make sure you actually have permission to
MagicJinn
MagicJinnOP3w ago
I plan to go the route of games like OpenRCT, Daggerfall Unity and OpenMW. Make the basegame a hard requirement.
Evyr
Evyr3w ago
in that case why are you not using a mod loader and patching the game on startup?
MagicJinn
MagicJinnOP3w ago
There are certain fundamental things that cannot be easily changed.
Want results from more Discord servers?
Add your server