Spell Extensions being added continously

Old bugs stored here for reference.
Locked
link2009
Retired
Posts: 390
Joined: Fri Aug 10, 2007 5:59 pm
Location: POrTal
Contact:

Spell Extensions being added continously

Post by link2009 » Fri May 02, 2008 4:51 pm

I know having a staircase of Sprint.lua is cool, but...
Image
Image
-Vecinu de la Patru

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Post by Zcoretri » Fri May 02, 2008 4:59 pm

I have noticed the same thing.
Image

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Fri May 02, 2008 5:06 pm

Code: Select all

LuaSpell* lua_spell = lua_interface->GetSpell((char*)spell->GetSpellData()->lua_script.c_str());
		if(!lua_spell){
			lua_spell = lua_interface->GetSpell((char*)spell->GetSpellData()->lua_script.append(".lua").c_str());
			if(!lua_spell)
				return;
		}
It is trying to find the spell first without an extension, if it cant find it it adds a .lua extension and tries again. I agree that it shouldn't keep adding a .lua to the end if it cant find it the second time and you keep calling the script. However, your server is not setup properly. You didnt copy the Spells directory (in Config Files) to your working directory.

link2009
Retired
Posts: 390
Joined: Fri Aug 10, 2007 5:59 pm
Location: POrTal
Contact:

Post by link2009 » Fri May 02, 2008 5:32 pm

Yeah, you should turn that off, I doubt someone would add sprint.lua.lua (sprint.lua in their DB).
And actually, I have the spells dir in my working dir and it loads Sprint when the server starts up. I still get that error.
Image
-Vecinu de la Patru

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Fri May 02, 2008 7:06 pm

That's not what he's saying. The code is a catch for someone who, in their DB, simply puts "Sprint" and not "Sprint.lua". If in the first case, the server goes to find a file named "Sprint" and cannot find it, the code appends ".lua" to the end of what is in the database in order to attempt to find the proper file name (which should be "Sprint.lua").
Why you are getting repeated appends is a good question, unless it is somehow "remembering" the previous lua_spell setting and still cannot find "Sprint" thus keeps appending over and over.
Maybe "lua_spell" needs to get cleared before being called again?

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Post by Zcoretri » Sat May 03, 2008 12:20 pm

I have copied the spells folder to my working dir
Image
Image

chrrox
Content Designer
Posts: 177
Joined: Wed Oct 17, 2007 8:12 pm

Post by chrrox » Sat May 03, 2008 1:11 pm

In your database rename the lua script from Sprint.lua to just plain Sprint

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Post by Zcoretri » Sat May 03, 2008 5:21 pm

Thats how I originally had it when I noticed this.
I will change it back and see what happens.
Edit: Works!, must be case sensitive. I think I had it without the capitol S originally.
Image

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sun May 04, 2008 10:01 am

Fixed in the latest revision (yet to be released).

link2009
Retired
Posts: 390
Joined: Fri Aug 10, 2007 5:59 pm
Location: POrTal
Contact:

Post by link2009 » Mon May 05, 2008 3:13 pm

LethalEncounter wrote:Fixed in the latest revision (yet to be released).
:lol:
Image
-Vecinu de la Patru

Locked

Who is online

Users browsing this forum: No registered users and 0 guests