Page 1 of 1
Spell Extensions being added continously
Posted: Fri May 02, 2008 4:51 pm
by link2009
I know having a staircase of Sprint.lua is cool, but...

Posted: Fri May 02, 2008 4:59 pm
by Zcoretri
I have noticed the same thing.
Posted: Fri May 02, 2008 5:06 pm
by LethalEncounter
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.
Posted: Fri May 02, 2008 5:32 pm
by link2009
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.
Posted: Fri May 02, 2008 7:06 pm
by John Adams
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?
Posted: Sat May 03, 2008 12:20 pm
by Zcoretri
I have copied the spells folder to my working dir

Posted: Sat May 03, 2008 1:11 pm
by chrrox
In your database rename the lua script from Sprint.lua to just plain Sprint
Posted: Sat May 03, 2008 5:21 pm
by Zcoretri
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.
Posted: Sun May 04, 2008 10:01 am
by LethalEncounter
Fixed in the latest revision (yet to be released).
Posted: Mon May 05, 2008 3:13 pm
by link2009
LethalEncounter wrote:Fixed in the latest revision (yet to be released).
