18.03.2011, 20:10
Platform(s): Windows 7 (32bit and 64bit).
Server/Client Server.
Tested by Kyoshiro and Aleco.
I discovered a very odd bug with the include directive that basically stops code from being included into other scripts. The conditions are a bit weird, and i have no definite answers on what the cause may be, all i can do is just spell out the conditions. I had a friend test this bug with me and it seems that im not the only one, its not including code for him as well.
Basically i had a folder named DM inside the scriptfiles folder, and inside my DM folder was a folder name Scripts. Inside this Scripts folder there were a number of include files that my server used. The problem is, once i included more than 1 script the include process just completely broke. It would ONLY include the FIRST file, and never anything else. I declared variables in the other scripts that do not get used at all to see if i would get a warning message saying "variable blahblah isnt used", but i got nothing at all. This just pretty much proved it wasn't getting included, but i also went ahead and added two functions that print() the file name, and they also failed to be included/to work.
The weird thing is, im not getting an fatal warnings, the script is reading the files just fine! I tried MULTIPLE ways to include these files, and none of them worked.
my first try that failed was (Note there was more than one include, im shortening it):
then after a bit of failed testing i tried:
Both of these method behaved exactly the same, ONE file was included (the first) and the rest were practically ignored. It wasn't until i moved my DM folder into the pawno/include folder that it actually worked (a friend also says that JUST the scriptfiles/DM/ worked for him. He said it stopped including code when he added another folder in the picture). Im thinking the issue is with long file paths (even though the above is pretty short-40 chars) or an issue related to folders. Im not really sure, and could use more testing to be honest (not sure if this is a pawn issue, or just a sa-mp issue either).
Its a pretty odd issue, and even though its not a common one, i think it should still be fixed (if possible) :P.
Server/Client Server.
Tested by Kyoshiro and Aleco.
I discovered a very odd bug with the include directive that basically stops code from being included into other scripts. The conditions are a bit weird, and i have no definite answers on what the cause may be, all i can do is just spell out the conditions. I had a friend test this bug with me and it seems that im not the only one, its not including code for him as well.
Basically i had a folder named DM inside the scriptfiles folder, and inside my DM folder was a folder name Scripts. Inside this Scripts folder there were a number of include files that my server used. The problem is, once i included more than 1 script the include process just completely broke. It would ONLY include the FIRST file, and never anything else. I declared variables in the other scripts that do not get used at all to see if i would get a warning message saying "variable blahblah isnt used", but i got nothing at all. This just pretty much proved it wasn't getting included, but i also went ahead and added two functions that print() the file name, and they also failed to be included/to work.
The weird thing is, im not getting an fatal warnings, the script is reading the files just fine! I tried MULTIPLE ways to include these files, and none of them worked.
my first try that failed was (Note there was more than one include, im shortening it):
Code:
#include "../scriptfiles/DM/Scripts/a_Master.txt"
Code:
#include <../../scriptfiles/DM/Scripts/a_Master.txt>
Its a pretty odd issue, and even though its not a common one, i think it should still be fixed (if possible) :P.