diff --git a/core/logic/PluginSys.cpp b/core/logic/PluginSys.cpp index c53d4fe3..ae7935f1 100644 --- a/core/logic/PluginSys.cpp +++ b/core/logic/PluginSys.cpp @@ -195,15 +195,20 @@ IPluginRuntime *CPlugin::GetRuntime() void CPlugin::SetErrorState(PluginStatus status, const char *error_fmt, ...) { - PluginStatus old_status = m_status; - m_status = status; - - if (old_status == Plugin_Running) + if (m_status == Plugin_Running) { /* Tell everyone we're now paused */ - g_PluginSys._SetPauseState(this, true); + SetPauseState(true); + /* If we won't recover from this error, drop everything and pause dependent plugins too! */ + if (status == Plugin_Failed) + { + DropEverything(); + } } + /* SetPauseState sets the status to Plugin_Paused, but we might want to see some other status set. */ + m_status = status; + va_list ap; va_start(ap, error_fmt); smcore.FormatArgs(m_errormsg, sizeof(m_errormsg), error_fmt, ap); @@ -531,7 +536,8 @@ bool CPlugin::SetPauseState(bool paused) if (paused && GetStatus() != Plugin_Running) { return false; - } else if (!paused && GetStatus() != Plugin_Paused) { + } + else if (!paused && GetStatus() != Plugin_Paused && GetStatus() != Plugin_Error) { return false; } @@ -539,6 +545,12 @@ bool CPlugin::SetPauseState(bool paused) { LibraryActions(LibraryAction_Removed); } + else + { + // Set to running again BEFORE trying to call OnPluginPauseChange ;) + m_status = Plugin_Running; + m_pRuntime->SetPauseState(false); + } IPluginFunction *pFunction = m_pRuntime->GetFunctionByName("OnPluginPauseChange"); if (pFunction) @@ -552,9 +564,6 @@ bool CPlugin::SetPauseState(bool paused) { m_status = Plugin_Paused; m_pRuntime->SetPauseState(true); - } else { - m_status = Plugin_Running; - m_pRuntime->SetPauseState(false); } g_PluginSys._SetPauseState(this, paused); @@ -1138,7 +1147,7 @@ void CPluginManager::LoadAll_SecondPass() if (!RunSecondPass(pPlugin, error, sizeof(error))) { g_Logger.LogError("[SM] Unable to load plugin \"%s\": %s", pPlugin->GetFilename(), error); - pPlugin->SetErrorState(Plugin_Failed, "%s", error); + pPlugin->SetErrorState(Plugin_BadLoad, "%s", error); } } } @@ -1496,11 +1505,9 @@ void CPluginManager::TryRefreshDependencies(CPlugin *pPlugin) if (pPlugin->GetStatus() == Plugin_Error) { /* If we got here, all natives are okay again! */ - pPlugin->m_status = Plugin_Running; if (pPlugin->m_pRuntime->IsPaused()) { - pPlugin->m_pRuntime->SetPauseState(false); - _SetPauseState(pPlugin, false); + pPlugin->SetPauseState(false); } } } @@ -2217,7 +2224,7 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c const sm_plugininfo_t *info = pl->GetPublicInfo(); rootmenu->ConsolePrint(" Filename: %s", pl->GetFilename()); - if (pl->GetStatus() <= Plugin_Error) + if (pl->GetStatus() <= Plugin_Error || pl->GetStatus() == Plugin_Failed) { if (IS_STR_FILLED(info->name)) { @@ -2240,7 +2247,7 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c { rootmenu->ConsolePrint(" URL: %s", info->url); } - if (pl->GetStatus() == Plugin_Error) + if (pl->GetStatus() == Plugin_Error || pl->GetStatus() == Plugin_Failed) { rootmenu->ConsolePrint(" Error: %s", pl->m_errormsg); } diff --git a/core/logic/smn_adt_array.cpp b/core/logic/smn_adt_array.cpp index 954b58cb..299c85a9 100644 --- a/core/logic/smn_adt_array.cpp +++ b/core/logic/smn_adt_array.cpp @@ -597,7 +597,7 @@ REGISTER_NATIVES(cellArrayNatives) {"ArrayList.Set", SetArrayCell}, {"ArrayList.SetString", SetArrayString}, {"ArrayList.SetArray", SetArrayArray}, - {"ArrayList.Erease", RemoveFromArray}, + {"ArrayList.Erase", RemoveFromArray}, {"ArrayList.ShiftUp", ShiftArrayUp}, {"ArrayList.SwapAt", SwapArrayItems}, {"ArrayList.Clone", CloneArray}, diff --git a/core/logic/smn_core.cpp b/core/logic/smn_core.cpp index 50eb0e5d..c595ebab 100644 --- a/core/logic/smn_core.cpp +++ b/core/logic/smn_core.cpp @@ -380,7 +380,7 @@ static cell_t SetFailState(IPluginContext *pContext, const cell_t *params) if (params[0] == 1) { - pPlugin->SetErrorState(Plugin_Error, "%s", str); + pPlugin->SetErrorState(Plugin_Failed, "%s", str); return pContext->ThrowNativeErrorEx(SP_ERROR_ABORTED, "%s", str); } @@ -391,12 +391,12 @@ static cell_t SetFailState(IPluginContext *pContext, const cell_t *params) g_pSM->FormatString(buffer, sizeof(buffer), pContext, params, 1); if (pContext->GetLastNativeError() != SP_ERROR_NONE) { - pPlugin->SetErrorState(Plugin_Error, "%s", str); + pPlugin->SetErrorState(Plugin_Failed, "%s", str); return pContext->ThrowNativeErrorEx(SP_ERROR_ABORTED, "Formatting error (%s)", str); } else { - pPlugin->SetErrorState(Plugin_Error, "%s", buffer); + pPlugin->SetErrorState(Plugin_Failed, "%s", buffer); return pContext->ThrowNativeErrorEx(SP_ERROR_ABORTED, "%s", buffer); } } @@ -774,4 +774,4 @@ REGISTER_NATIVES(coreNatives) {"LoadFromAddress", LoadFromAddress}, {"StoreToAddress", StoreToAddress}, {NULL, NULL}, -}; \ No newline at end of file +}; diff --git a/core/smn_halflife.cpp b/core/smn_halflife.cpp index b27a7e4f..c49c6431 100644 --- a/core/smn_halflife.cpp +++ b/core/smn_halflife.cpp @@ -572,6 +572,47 @@ static cell_t ReferenceToBCompatRef(IPluginContext *pContext, const cell_t *para return g_HL2.ReferenceToBCompatRef(params[1]); } +// Must match ClientRangeType enum in halflife.inc +enum class ClientRangeType : cell_t +{ + Visibility = 0, + Audibility, +}; + +static cell_t GetClientsInRange(IPluginContext *pContext, const cell_t *params) +{ + cell_t *origin; + pContext->LocalToPhysAddr(params[1], &origin); + + Vector vOrigin(sp_ctof(origin[0]), sp_ctof(origin[1]), sp_ctof(origin[2])); + + ClientRangeType rangeType = (ClientRangeType) params[2]; + + CBitVec players; + engine->Message_DetermineMulticastRecipients(rangeType == ClientRangeType::Audibility, vOrigin, players); + + cell_t *outPlayers; + pContext->LocalToPhysAddr(params[3], &outPlayers); + + int maxPlayers = params[4]; + int curPlayers = 0; + + int index = players.FindNextSetBit(0); + while (index > -1 && curPlayers < maxPlayers) + { + int entidx = index + 1; + CPlayer *pPlayer = g_Players.GetPlayerByIndex(entidx); + if (pPlayer && pPlayer->IsInGame()) + { + outPlayers[curPlayers++] = entidx; + } + + index = players.FindNextSetBit(index + 1); + } + + return curPlayers; +} + REGISTER_NATIVES(halflifeNatives) { {"CreateFakeClient", CreateFakeClient}, @@ -607,5 +648,6 @@ REGISTER_NATIVES(halflifeNatives) {"EntIndexToEntRef", IndexToReference}, {"EntRefToEntIndex", ReferenceToIndex}, {"MakeCompatEntRef", ReferenceToBCompatRef}, + {"GetClientsInRange", GetClientsInRange}, {NULL, NULL}, }; diff --git a/core/sourcemm_api.cpp b/core/sourcemm_api.cpp index 902a241e..8daeb2e0 100644 --- a/core/sourcemm_api.cpp +++ b/core/sourcemm_api.cpp @@ -51,7 +51,9 @@ IPlayerInfoManager *playerinfo = NULL; IBaseFileSystem *basefilesystem = NULL; IFileSystem *filesystem = NULL; IEngineSound *enginesound = NULL; +#if SOURCE_ENGINE >= SE_ORANGEBOX IServerTools *servertools = NULL; +#endif IServerPluginHelpers *serverpluginhelpers = NULL; IServerPluginCallbacks *vsp_interface = NULL; int vsp_version = 0; @@ -70,7 +72,9 @@ bool SourceMod_Core::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen GET_V_IFACE_CURRENT(GetFileSystemFactory, basefilesystem, IBaseFileSystem, BASEFILESYSTEM_INTERFACE_VERSION); GET_V_IFACE_CURRENT(GetFileSystemFactory, filesystem, IFileSystem, FILESYSTEM_INTERFACE_VERSION); GET_V_IFACE_CURRENT(GetEngineFactory, enginesound, IEngineSound, IENGINESOUND_SERVER_INTERFACE_VERSION); +#if SOURCE_ENGINE >= SE_ORANGEBOX GET_V_IFACE_CURRENT(GetServerFactory, servertools, IServerTools, VSERVERTOOLS_INTERFACE_VERSION); +#endif #if SOURCE_ENGINE != SE_DOTA GET_V_IFACE_CURRENT(GetEngineFactory, serverpluginhelpers, IServerPluginHelpers, INTERFACEVERSION_ISERVERPLUGINHELPERS); #endif diff --git a/core/sourcemm_api.h b/core/sourcemm_api.h index 29815005..c813f27e 100644 --- a/core/sourcemm_api.h +++ b/core/sourcemm_api.h @@ -102,7 +102,9 @@ extern IPlayerInfoManager *playerinfo; extern IBaseFileSystem *basefilesystem; extern IFileSystem *filesystem; extern IEngineSound *enginesound; +#if SOURCE_ENGINE >= SE_ORANGEBOX extern IServerTools *servertools; +#endif extern IServerPluginHelpers *serverpluginhelpers; extern IServerPluginCallbacks *vsp_interface; extern int vsp_version; diff --git a/extensions/sdkhooks/extension.cpp b/extensions/sdkhooks/extension.cpp index d24c1527..1cfd27ab 100644 --- a/extensions/sdkhooks/extension.cpp +++ b/extensions/sdkhooks/extension.cpp @@ -219,6 +219,26 @@ bool SDKHooks::SDK_OnLoad(char *error, size_t maxlength, bool late) return false; } + buffer[0] = '\0'; + if (!gameconfs->LoadGameConfigFile("sdkhooks.games", &g_pGameConf, buffer, sizeof(buffer))) + { + if (buffer[0]) + { + g_pSM->Format(error, maxlength, "Could not read sdkhooks.games gamedata: %s", buffer); + } + + return false; + } + + CUtlVector *entListeners = EntListeners(); + if (!entListeners) + { + g_pSM->Format(error, maxlength, "Failed to setup entity listeners"); + return false; + } + + entListeners->AddToTail(this); + sharesys->AddDependency(myself, "bintools.ext", true, true); sharesys->AddNatives(myself, g_Natives); sharesys->RegisterLibrary(myself, "sdkhooks"); @@ -237,26 +257,6 @@ bool SDKHooks::SDK_OnLoad(char *error, size_t maxlength, bool late) #endif g_pOnLevelInit = forwards->CreateForward("OnLevelInit", ET_Hook, 2, NULL, Param_String, Param_String); - buffer[0] = '\0'; - if (!gameconfs->LoadGameConfigFile("sdkhooks.games", &g_pGameConf, buffer, sizeof(buffer))) - { - if (buffer[0]) - { - g_pSM->Format(error, maxlength, "Could not read sdkhooks.games gamedata: %s", buffer); - } - - return false; - } - - CUtlVector *entListeners = EntListeners(); - if (!entListeners) - { - g_pSM->Format(error, maxlength, "Failed to setup entity listeners"); - return false; - } - - entListeners->AddToTail(this); - SetupHooks(); #if SOURCE_ENGINE >= SE_ORANGEBOX diff --git a/extensions/sdktools/vhelpers.cpp b/extensions/sdktools/vhelpers.cpp index d6a41753..9207dcba 100644 --- a/extensions/sdktools/vhelpers.cpp +++ b/extensions/sdktools/vhelpers.cpp @@ -822,11 +822,11 @@ void UTIL_DrawDataTable(FILE *fp, datamap_t *pMap, int level) if (externalname == NULL) { - fprintf(fp,"%s- %s (%s)(%i Bytes)\n", spaces, pMap->dataDesc[i].fieldName, flags, pMap->dataDesc[i].fieldSizeInBytes); + fprintf(fp, "%s- %s (Offset %d) (%s)(%i Bytes)\n", spaces, pMap->dataDesc[i].fieldName, GetTypeDescOffs(&pMap->dataDesc[i]), flags, pMap->dataDesc[i].fieldSizeInBytes); } else { - fprintf(fp,"%s- %s (%s)(%i Bytes) - %s\n", spaces, pMap->dataDesc[i].fieldName, flags, pMap->dataDesc[i].fieldSizeInBytes, externalname); + fprintf(fp, "%s- %s (Offset %d) (%s)(%i Bytes) - %s\n", spaces, pMap->dataDesc[i].fieldName, GetTypeDescOffs(&pMap->dataDesc[i]), flags, pMap->dataDesc[i].fieldSizeInBytes, externalname); } } } diff --git a/gamedata/core.games/engine.sdk2013.txt b/gamedata/core.games/engine.sdk2013.txt index 4912944c..d5f6764d 100644 --- a/gamedata/core.games/engine.sdk2013.txt +++ b/gamedata/core.games/engine.sdk2013.txt @@ -29,13 +29,6 @@ "windows" "11" "linux" "13" } - - "EntInfo" - { - "windows" "4" - "linux" "4" - "mac" "4" - } } "Signatures" @@ -54,24 +47,15 @@ } } - /* CGlobalEntityList */ "#default" { - /* These games do have symbols in the linux binaries */ - "#supported" + "Keys" { - "game" "fof" - "game" "nmrih" + "UseInvalidUniverseInSteam2IDs" "1" } "Offsets" { - /* Offset into LevelShutdown */ - "gEntList" - { - "windows" "11" - } - "EntInfo" { "windows" "4" @@ -79,28 +63,5 @@ "mac" "4" } } - - "Signatures" - { - "LevelShutdown" - { - "library" "server" - "windows" "\xE8\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xE8" - } - "gEntList" - { - "library" "server" - "linux" "@gEntList" - "mac" "@gEntList" - } - } - } - - "#default" - { - "Keys" - { - "UseInvalidUniverseInSteam2IDs" "1" - } } } diff --git a/plugins/basetriggers.sp b/plugins/basetriggers.sp index 8753a408..20a574c8 100644 --- a/plugins/basetriggers.sp +++ b/plugins/basetriggers.sp @@ -71,7 +71,7 @@ public OnPluginStart() LoadTranslations("common.phrases"); LoadTranslations("basetriggers.phrases"); - g_Cvar_TriggerShow = CreateConVar("sm_trigger_show", "1", "Display triggers message to all players? (0 off, 1 on, def. 1)", 0, true, 0.0, true, 1.0); + g_Cvar_TriggerShow = CreateConVar("sm_trigger_show", "0", "Display triggers message to all players? (0 off, 1 on, def. 0)", 0, true, 0.0, true, 1.0); g_Cvar_TimeleftInterval = CreateConVar("sm_timeleft_interval", "0.0", "Display timeleft every x seconds. Default 0.", 0, true, 0.0, true, 1800.0); g_Cvar_FriendlyFire = FindConVar("mp_friendlyfire"); diff --git a/plugins/include/adt_array.inc b/plugins/include/adt_array.inc index c16934e0..3bd3378d 100644 --- a/plugins/include/adt_array.inc +++ b/plugins/include/adt_array.inc @@ -67,7 +67,7 @@ methodmap ArrayList < Handle { public native ArrayList(int blocksize=1, int startsize=0); // Clears an array of all entries. This is the same as Resize(0). - public native void ClearArray(); + public native void Clear(); // Clones an array, returning a new handle with the same size and data. // This should NOT be confused with CloneHandle. This is a completely new diff --git a/plugins/include/dbi.inc b/plugins/include/dbi.inc index 71ca686d..7c2325bd 100644 --- a/plugins/include/dbi.inc +++ b/plugins/include/dbi.inc @@ -477,13 +477,13 @@ stock Database SQLite_UseDatabase(const char[] database, char[] error, maxlength) { - new Handle kv, Handle db; + Handle kv, db; kv = CreateKeyValues(""); KvSetString(kv, "driver", "sqlite"); KvSetString(kv, "database", database); - db = SQL_ConnectCustom(kv, error, int maxlength, false); + db = SQL_ConnectCustom(kv, error, maxlength, false); CloseHandle(kv); @@ -641,7 +641,7 @@ stock bool SQL_QuoteString(Handle database, maxlength, &written=0) { - return SQL_EscapeString(database, string, buffer, int maxlength, written); + return SQL_EscapeString(database, string, buffer, maxlength, written); } /** diff --git a/plugins/include/halflife.inc b/plugins/include/halflife.inc index 22cc9d30..4514bb08 100644 --- a/plugins/include/halflife.inc +++ b/plugins/include/halflife.inc @@ -624,3 +624,21 @@ native EntRefToEntIndex(ref); */ native MakeCompatEntRef(ref); + +enum ClientRangeType +{ + RangeType_Visibility = 0, + RangeType_Audibility, +} + +/** + * Find clients that are potentially in range of a position. + * + * @param origin Coordinates from which to test range. + * @param rangeType Range type to use for filtering clients. + * @param clients Array to which found client indexes will be written. + * @param size Maximum size of clients array. + * @return Number of client indexes written to clients array. + */ +native int GetClientsInRange(float origin[3], ClientRangeType rangeType, int[] clients, int size); + diff --git a/plugins/include/sdkhooks.inc b/plugins/include/sdkhooks.inc index e47e2fc6..44a448a2 100644 --- a/plugins/include/sdkhooks.inc +++ b/plugins/include/sdkhooks.inc @@ -264,7 +264,9 @@ typeset SDKHookCB // OnTakeDamagePost // OnTakeDamageAlivePost function void (int victim, int attacker, int inflictor, float damage, int damagetype); - function void (int victim, int attacker, int inflictor, float damage, int damagetype, const float damageForce[3], const float damagePosition[3]); + function void (int victim, int attacker, int inflictor, float damage, int damagetype, int weapon, const float damageForce[3], const float damagePosition[3]); + function void (int victim, int attacker, int inflictor, float damage, int damagetype, int weapon, + const float damageForce[3], const float damagePosition[3], int damagecustom); // FireBulletsPost function void (int client, int shots, const char[] weaponname); diff --git a/sourcepawn/compiler/sc.h b/sourcepawn/compiler/sc.h index a6ed6ec1..29ad5c4b 100644 --- a/sourcepawn/compiler/sc.h +++ b/sourcepawn/compiler/sc.h @@ -487,7 +487,6 @@ enum TokenKind { tpDEFINE, tpELSE, /* #else */ tpELSEIF, /* #elseif */ - tpEMIT, tpENDIF, tpENDINPUT, tpENDSCRPT, diff --git a/sourcepawn/compiler/sc1.cpp b/sourcepawn/compiler/sc1.cpp index 0cc07861..ec76e3d3 100644 --- a/sourcepawn/compiler/sc1.cpp +++ b/sourcepawn/compiler/sc1.cpp @@ -1445,12 +1445,25 @@ static void dodecl(const token_t *tok) return; } - int fpublic = (tok->id == tPUBLIC); - int fstock = (tok->id == tSTOCK); - int fstatic = (tok->id == tSTATIC); + int fpublic = FALSE, fstock = FALSE, fstatic = FALSE, fconst = FALSE; + switch (tok->id) { + case tPUBLIC: + fpublic = TRUE; + break; + case tSTOCK: + fstock = TRUE; + if (matchtoken(tSTATIC)) + fstatic = TRUE; + break; + case tSTATIC: + fstatic = TRUE; - if (fstatic && matchtoken(tSTOCK)) - fstock = TRUE; + // For compatibility, we must include this case. Though "stock" should + // come first. + if (matchtoken(tSTOCK)) + fstock = TRUE; + break; + } int flags = DECLFLAG_MAYBE_FUNCTION | DECLFLAG_VARIABLE | DECLFLAG_ENUMROOT; if (tok->id == tNEW) @@ -1462,7 +1475,13 @@ static void dodecl(const token_t *tok) decl.type.tag = 0; } - if (!decl.opertok && (tok->id == tNEW || decl.type.has_postdims || !lexpeek('('))) { + // Hacky bag o' hints as to whether this is a variable decl. + bool probablyVariable = tok->id == tNEW || + decl.type.has_postdims || + !lexpeek('(') || + ((decl.type.usage & uCONST) == uCONST); + + if (!decl.opertok && probablyVariable) { if (tok->id == tNEW && decl.type.is_new) error(143); if (decl.type.tag & STRUCTTAG) { @@ -4628,9 +4647,9 @@ static void decl_enum(int vclass) char *str; int tag,explicittag; cell increment,multiplier; - constvalue *enumroot; LayoutSpec spec; symbol *enumsym = nullptr; + constvalue *enumroot = nullptr; /* get an explicit tag, if any (we need to remember whether an explicit * tag was passed, even if that explicit tag was "_:", so we cannot call diff --git a/sourcepawn/compiler/sc2.cpp b/sourcepawn/compiler/sc2.cpp index df0cdeea..b2856877 100644 --- a/sourcepawn/compiler/sc2.cpp +++ b/sourcepawn/compiler/sc2.cpp @@ -1036,10 +1036,6 @@ static int command(void) } /* if */ if (!cp_set(name)) error(FATAL_ERROR_NO_CODEPAGE); - } else if (strcmp(str,"compress")==0) { - cell val; - preproc_expr(&val,NULL); - sc_compress=(int)val; /* switch code packing on/off */ } else if (strcmp(str,"ctrlchar")==0) { while (*lptr<=' ' && *lptr!='\0') lptr++; @@ -1059,70 +1055,6 @@ static int command(void) lptr=(unsigned char*)strchr((char*)lptr,'\0'); /* skip to end (ignore "extra characters on line") */ } else if (strcmp(str,"dynamic")==0) { preproc_expr(&pc_stksize,NULL); - } else if (!strcmp(str,"library") - ||!strcmp(str,"reqclass") - ||!strcmp(str,"loadlib") - ||!strcmp(str,"explib") - ||!strcmp(str,"expclass") - ||!strcmp(str,"defclasslib")) { - char name[sNAMEMAX+1],sname[sNAMEMAX+1]; - const char *prefix=""; - sname[0]='\0'; - sname[1]='\0'; - if (!strcmp(str,"library")) - prefix="??li_"; - else if (!strcmp(str,"reqclass")) - prefix="??rc_"; - else if (!strcmp(str,"loadlib")) - prefix="??f_"; - else if (!strcmp(str,"explib")) - prefix="??el_"; - else if (!strcmp(str,"expclass")) - prefix="??ec_"; - else if (!strcmp(str,"defclasslib")) - prefix="??d_"; - while (*lptr<=' ' && *lptr!='\0') - lptr++; - if (*lptr=='"') { - lptr=getstring((unsigned char*)name,sizeof name,lptr); - } else { - int i; - for (i=0; iident!=iFUNCTN && sym->ident!=iREFFUNC && (sym->usage & uDEFINE)==0)) { - error(17,str); /* undefined symbol */ - } else { - outval(sym->addr,FALSE); - /* mark symbol as "used", unknown whether for read or write */ - markusage(sym,uREAD | uWRITTEN); - code_idx+=opargs(1); - } /* if */ - break; - default: { - char s2[20]; - extern const char *sc_tokens[];/* forward declaration */ - if (tok<256) - sprintf(s2,"%c",(char)tok); - else - strcpy(s2,sc_tokens[tok-tFIRST]); - error(1,sc_tokens[tSYMBOL-tFIRST],s2); - break; - } /* case */ - } /* switch */ - } /* if */ - stgwrite("\n"); - check_empty(lptr); - break; - } /* case */ -#endif #if !defined NO_DEFINE case tpDEFINE: { ret=CMD_DEFINE; @@ -2047,7 +1923,7 @@ const char *sc_tokens[] = { "volatile", "while", "with", - "#assert", "#define", "#else", "#elseif", "#emit", "#endif", "#endinput", + "#assert", "#define", "#else", "#elseif", "#endif", "#endinput", "#endscript", "#error", "#file", "#if", "#include", "#line", "#pragma", "#tryinclude", "#undef", ";", ";", "-integer value-", "-rational value-", "-identifier-", diff --git a/sourcepawn/compiler/tests/ok-static-stocks-1.sp b/sourcepawn/compiler/tests/ok-static-stocks-1.sp new file mode 100644 index 00000000..bf523238 --- /dev/null +++ b/sourcepawn/compiler/tests/ok-static-stocks-1.sp @@ -0,0 +1,5 @@ +static stock const X = 5; +stock static const Y = 6; + +public main() +{} diff --git a/sourcepawn/compiler/tests/ok-static-stocks-2.sp b/sourcepawn/compiler/tests/ok-static-stocks-2.sp new file mode 100644 index 00000000..2ced8743 --- /dev/null +++ b/sourcepawn/compiler/tests/ok-static-stocks-2.sp @@ -0,0 +1,7 @@ +static stock const X = 5; +stock static const Y = 6; + +public main() +{ + return X + Y; +}