Commit d4aad6f5 authored by Andrew Price's avatar Andrew Price

Don't load mwscript scripts

(Or anything that isn't .mwrc or a .js file)
parent 3d5db0e9
......@@ -49,14 +49,7 @@ void perms_restore(void)
}
}
static void warn_of_mwscript_death(const char *filename)
{
// Slightly obnoxious by design
printf("*** You are using mwscript scripts: %s\n", filename);
printf("*** mwscript support will be removed from mw on April 7th 2019.\n");
}
int do_warn_of_mwscript_death = 0;
int mwrc_loaded = 0;
static int ReadInitFile(const char *base, const char *filename)
{
FILE *file;
......@@ -125,12 +118,11 @@ static int ReadInitFile(const char *base, const char *filename)
return 0; // changed because if an error occured after this point the file exists, the js code has reported the error to the user and returning 1 will report to them that it doesn't exist
}
/* Warnings for the initial .mwrc are a little OTT for now but warn on
subsequent mwscript loads */
if (do_warn_of_mwscript_death)
warn_of_mwscript_death(filename);
else
do_warn_of_mwscript_death = 1;
if (mwrc_loaded) {
fprintf(stderr, "Warning: file included in .mwrc not supported: %s\n", filename);
return 0;
} else
mwrc_loaded = 1;
lineno=0;
while (!feof(file))
......
......@@ -338,7 +338,7 @@ void t_mwrc(CommandList *cm, int argc, const char **argv, char *args)
}
}
extern int do_warn_of_mwscript_death;
extern int mwrc_loaded;
void t_restart(CommandList *cm, int argc, const char **argv, char *args)
{
extern var_list_t var_list;
......@@ -361,7 +361,7 @@ void t_restart(CommandList *cm, int argc, const char **argv, char *args)
RoomDestroy(&user->room);
do_warn_of_mwscript_death = 0;
mwrc_loaded = 0;
RoomInit(&user->room);
LoadRoom(&user->room, user->record.room);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment