openplanet-nl / issues

Issue tracker for Openplanet.
10 stars 0 forks source link

missing preprocessor causes game to hang on load #420

Closed ezio416 closed 4 months ago

ezio416 commented 7 months ago

In resolving a merge conflict, I somehow deleted a #if TMNEXT that was before #elif MP4 and #endif. The last lines of the log did show this error:

[    ScriptEngine] [20:04:27]  Unexpected #elif on line 137
[    ScriptEngine] [20:04:27]  Unexpected #endif on line 163

However, this made the game hang indefinitely on the "Connecting" screen when I tried to boot it up. This should instead just throw an error and refuse to compile the plugin

codecat commented 6 months ago

I am unable to reproduce with this test plugin:

void Main()
{
    print("No");
#elif MP4
    print("Yes");
#endif
}

Do you have any more details on this issue?

ezio416 commented 6 months ago

I also can't reproduce with your case so it seems more specific than that. I pulled this from a version of Current Surfaces where it originally broke, and this minimal case does cause the game not to load:

string MaterialName(EPlugSurfaceMaterialId mat) {
    return "";
}

#elif MP4
string MaterialName(CAudioSourceSurface::ESurfId mat) {
    return "";
}
#endif

Maybe it has to do with defining a function multiple times since when preprocessors are unexpected, they end up being ignored

codecat commented 6 months ago

I am still unable to reproduce this with your code:

image

ezio416 commented 4 months ago

I can't reproduce this anymore myself, maybe this was fixed in a recent update