From ff31d8df49f98dde58df60973443443fb8e59d07 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 6 Jul 2014 23:59:15 -0700 Subject: [PATCH] Update nominations.sp and improve compiler error messaging. --- plugins/nominations.sp | 6 +++--- sourcepawn/compiler/sc3.c | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/nominations.sp b/plugins/nominations.sp index a4be8d96..1cf6078f 100644 --- a/plugins/nominations.sp +++ b/plugins/nominations.sp @@ -96,7 +96,7 @@ public void OnConfigsExecuted() BuildMapMenu(); } -public void OnNominationRemoved(char[] map, int owner) +public void OnNominationRemoved(const char[] map, int owner) { int status; @@ -300,8 +300,8 @@ void BuildMapMenu() g_MapMenu.AddItem(map, map); g_mapTrie.SetValue(map, status); } - - g_MapMenu.SetExitButton(true); + + g_MapMenu.ExitButton = true; delete excludeMaps; } diff --git a/sourcepawn/compiler/sc3.c b/sourcepawn/compiler/sc3.c index befbdff5..28e85bce 100644 --- a/sourcepawn/compiler/sc3.c +++ b/sourcepawn/compiler/sc3.c @@ -2191,6 +2191,14 @@ restart: if (!method || !method->target) { error(105, map->name, lexstr); + + // Fetch a fake function so errors aren't as crazy. + char tmpname[METHOD_NAMEMAX + 1]; + strcpy(tmpname, map->name); + strcat(tmpname, "."); + strcat(tmpname, lexstr); + tmpname[sNAMEMAX] = '\0'; + sym = fetchfunc(tmpname); } else { implicitthis = &thisval; sym = method->target;