Commit c4b787b5 authored by Andrew Price's avatar Andrew Price
Browse files

Don't warn about mwscript going away for .mwrc on .restart

Also clear eventin_list on .restart
parent 5301459f
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ static void warn_of_mwscript_death(const char *filename)
	printf("*** mwscript support will be removed from mw on April 7th 2019.\n");
}

int do_warn_of_mwscript_death = 0;
static int ReadInitFile(const char *base, const char *filename)
{
	FILE *file;
@@ -64,7 +65,6 @@ static int ReadInitFile(const char *base, const char *filename)
	char *a, *b, *c;
	int lineno;
	struct stat stats;
	static int do_warn = 0;

	if (strncasecmp(filename, "http://", 7)==0
	||  strncasecmp(filename, "https://", 8)==0) {
@@ -127,10 +127,10 @@ static int ReadInitFile(const char *base, const char *filename)

	/* Warnings for the initial .mwrc are a little OTT for now but warn on
	   subsequent mwscript loads */
	if (do_warn)
	if (do_warn_of_mwscript_death)
		warn_of_mwscript_death(filename);
	else
		do_warn = 1;
		do_warn_of_mwscript_death = 1;

	lineno=0;
	while (!feof(file))
+3 −0
Original line number Diff line number Diff line
@@ -341,6 +341,7 @@ void t_mwrc(CommandList *cm, int argc, const char **argv, char *args)
	}
}

extern int do_warn_of_mwscript_death;
void t_restart(CommandList *cm, int argc, const char **argv, char *args)
{
	extern var_list_t	var_list;
@@ -353,6 +354,7 @@ void t_restart(CommandList *cm, int argc, const char **argv, char *args)
	DestroyAllLinks(&alias_list); alias_list = NULL;
	DestroyAllLinks(&rpc_list); rpc_list = NULL;
	DestroyAllLinks(&event_list); event_list = NULL;
	DestroyAllLinks(&eventin_list); eventin_list = NULL;
	DestroyAllLinks(&onoff_list); onoff_list = NULL;
	DestroyAllLinks(&ipc_list); ipc_list = NULL;
	DestroyAllLinks(&force_list); force_list = NULL;
@@ -363,6 +365,7 @@ void t_restart(CommandList *cm, int argc, const char **argv, char *args)

	RoomDestroy(&user->room);

	do_warn_of_mwscript_death = 0;
	RoomInit(&user->room);
	LoadRoom(&user->room, user->record.room);