Git Product home page Git Product logo

Comments (2)

Batfoxkid avatar Batfoxkid commented on June 19, 2024

This is a result of a coding mistake done in the original FF2 subplugin include. There is no way to fix this through the main plugin and all subplugins using this include need to be compiled to fix this issue.

void GetThisPluginName()
{
	char pluginName[80];
	GetPluginFilename(INVALID_HANDLE, pluginName, sizeof(pluginName));
	
	int finalPluginName = -1;
	for(;;)
	{
		int forwardSlash = StrContains(pluginName[finalPluginName+1], "/");
		int backwardSlash = StrContains(pluginName[finalPluginName+1], "\\");
		if((backwardSlash<forwardSlash && backwardSlash!=-1) || forwardSlash==-1)
		{
			if(backwardSlash == -1)
				break;
+			
+			if(finalPluginName == -1)
+				finalPluginName = 0;
+			
+			finalPluginName += backwardSlash;
-			finalPluginName = backwardSlash;
		}
		else if((forwardSlash<backwardSlash && forwardSlash!=-1) || backwardSlash==-1)
		{
			if(forwardSlash == -1)
				break;
+			
+			if(finalPluginName == -1)
+				finalPluginName = 0;
+			
+			finalPluginName += forwardSlash;
-			finalPluginName = forwardSlash;
		}
	}
	strcopy(this_plugin_name, sizeof(this_plugin_name), pluginName[finalPluginName+1]);
}

from freak-fortress-2-rewrite.

DanishSoup avatar DanishSoup commented on June 19, 2024

This is a result of a coding mistake done in the original FF2 subplugin include. There is no way to fix this through the main plugin and all subplugins using this include need to be compiled to fix this issue.

void GetThisPluginName()
{
	char pluginName[80];
	GetPluginFilename(INVALID_HANDLE, pluginName, sizeof(pluginName));
	
	int finalPluginName = -1;
	for(;;)
	{
		int forwardSlash = StrContains(pluginName[finalPluginName+1], "/");
		int backwardSlash = StrContains(pluginName[finalPluginName+1], "\\");
		if((backwardSlash<forwardSlash && backwardSlash!=-1) || forwardSlash==-1)
		{
			if(backwardSlash == -1)
				break;
+			
+			if(finalPluginName == -1)
+				finalPluginName = 0;
+			
+			finalPluginName += backwardSlash;
-			finalPluginName = backwardSlash;
		}
		else if((forwardSlash<backwardSlash && forwardSlash!=-1) || backwardSlash==-1)
		{
			if(forwardSlash == -1)
				break;
+			
+			if(finalPluginName == -1)
+				finalPluginName = 0;
+			
+			finalPluginName += forwardSlash;
-			finalPluginName = forwardSlash;
		}
	}
	strcopy(this_plugin_name, sizeof(this_plugin_name), pluginName[finalPluginName+1]);
}

I seem to still be having problems when trying to load legacy plugins through another directory. I applied both of the freak_fortress_2_subplugins.inc edits provided and I would get this error in console

L 07/29/2023 - 11:28:01: [SM] Blaming: disabled/freaks/ff2_phatrages.smx
L 07/29/2023 - 11:28:01: [SM] Call stack trace:
L 07/29/2023 - 11:28:01: [SM]   [1] Line 9, /home/danish/Downloads/freak_fortress_2/addons/sourcemod/scripting/include/freak_fortress_2_subplugin.inc::GetThisPluginName
L 07/29/2023 - 11:28:01: [SM]   [2] Line 40, /home/danish/Downloads/freak_fortress_2/addons/sourcemod/scripting/include/freak_fortress_2_subplugin.inc::OnPluginStart
L 07/29/2023 - 11:28:01: [SM]   [4] ServerExecute
L 07/29/2023 - 11:28:01: [SM]   [5] Line 3116, freak_fortress_2/bosses.sp::EnableSubplugins
L 07/29/2023 - 11:28:01: [SM]   [6] Line 1602, freak_fortress_2/bosses.sp::Bosses_CreateFromConfig
L 07/29/2023 - 11:28:01: [SM]   [7] Line 1576, freak_fortress_2/bosses.sp::Bosses_CreateFromSpecial
L 07/29/2023 - 11:28:01: [SM]   [8] Line 250, freak_fortress_2/gamemode.sp::Gamemode_RoundSetup
L 07/29/2023 - 11:28:01: [SM]   [9] Line 362, freak_fortress_2/dhooks.sp::DHook_RoundRespawn
[SM] Plugin disabled/freaks/ff2_phatrages.smx failed to load: Error detected in plugin startup (see error logs).
[SM] Loaded plugin disabled/freaks/ff2r_epic_abilities.smx successfully.
[SM] Loaded plugin disabled/freaks/ff2r_menu_abilities.smx successfully.
[SM] Loaded plugin disabled/freaks/ff2r_tfcond.smx successfully.
[SM] Loaded plugin disabled/freaks/ff2r_default_abilities.smx successfully.

Before the boss round starts, it would hang up for a few seconds but the plugin would refuse to work

from freak-fortress-2-rewrite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.