Comment Snarfer in Parser.cpp
I am a old, rusty coder, but was able to code in a quick fix to the "Comment at the beginning of the .qst file makes quests not work" bug. It's based off version 1.1.1.2 of parser.cpp
Would this be something worth posting? I didn't see any mention of it being fixed already. :lol: Regards, Krich |
Feel free to post it. If it's not in yet, I'll throw it in..
|
I've hacked my CVS parser.cpp (among others) to work with 0.4.3, so a diff would cause confusion. The code is exceedingly simple, so I'll just do it the old fashioned way.
In void Parser::LoadScript(int npcid, const char *zone) add the variable comment in variable declarations in beginning of subroutine around line 980 or so: Code:
int quote = 0; Then add/modify the following lines around line 1075 or so: Code:
if (buffer[i] == '\n') line_num++; That should do it. Essentially it prevents any comment from being populated into temp, which is where the commands are being assembled one character at a time. Regards, Krich |
Confirmed it's been merged and looks good.
Regards, krich |
Trump,
I just realized that if I increment/decrement the variable comment, I can support nested comments, so change the following lines from: Code:
if (buffer[i] == '\n') line_num++; Code:
if (buffer[i] == '\n') line_num++; Regards, krich |
Good change, catching it in cvs. Verify it in there tomorrow...
|
It's in, looks good, and works!
Thanks Trumpcard. Regards, krich |
All times are GMT -4. The time now is 05:19 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.