extensions/tf2/extension.cpp
changeset 2069 80d56f1d58fe
parent 1979 d36fac1a8203
child 2075 ffc871fb7cc8
     1.1 --- a/extensions/tf2/extension.cpp	Sat May 24 03:04:10 2008 +0000
     1.2 +++ b/extensions/tf2/extension.cpp	Sat May 24 04:08:29 2008 +0000
     1.3 @@ -63,11 +63,16 @@
     1.4  
     1.5  bool TF2Tools::SDK_OnLoad(char *error, size_t maxlength, bool late)
     1.6  {
     1.7 +	if (strcmp(g_pSM->GetGameFolderName(), "tf") != 0)
     1.8 +	{
     1.9 +		snprintf(error, maxlength, "Cannot Load TF2 Extension on mods other than TF2");
    1.10 +		return false;
    1.11 +	}
    1.12 +
    1.13  	ServerClass *sc = UTIL_FindServerClass("CTFPlayer");
    1.14  	if (sc == NULL)
    1.15  	{
    1.16  		snprintf(error, maxlength, "Could not find CTFPlayer server class");
    1.17 -
    1.18  		return false;
    1.19  	}
    1.20  
    1.21 @@ -76,7 +81,6 @@
    1.22  	if (!UTIL_FindDataTable(sc->m_pTable, "DT_TFPlayerShared", playerSharedOffset, 0))
    1.23  	{
    1.24  		snprintf(error, maxlength, "Could not find DT_TFPlayerShared data table");
    1.25 -
    1.26  		return false;
    1.27  	}
    1.28  
    1.29 @@ -85,7 +89,7 @@
    1.30  	char conf_error[255];
    1.31  	if (!gameconfs->LoadGameConfigFile("sm-tf2.games", &g_pGameConf, conf_error, sizeof(conf_error)))
    1.32  	{
    1.33 -		if (error)
    1.34 +		if (conf_error)
    1.35  		{
    1.36  			snprintf(error, maxlength, "Could not read sm-tf2.games.txt: %s", conf_error);
    1.37  		}