* fixed a major bug in the DefScript engine that messed up correct bracketing in nested fuctions (example:

?{equal,{hello world} {hello world}} returning false.
* enabled map tile duming also for release mode
* small fix with SCP reading in case this should ever be ported to mac osx.
This commit is contained in:
False.Genesis 2007-10-16 12:07:11 +00:00
parent f4829928e8
commit 993bc000df
4 changed files with 4 additions and 12 deletions

View File

@ -810,7 +810,7 @@ DefXChgResult DefScriptPackage::ReplaceVars(std::string str, CmdSet *pSet, unsig
if(!bracketsOpen) if(!bracketsOpen)
{ {
closingBracket=i; closingBracket=i;
if(nextVar==DEFSCRIPT_NONE && VarType!=DEFSCRIPT_NONE && !hasVar) // remove brackets in var names, like ${var{ia}ble} if(nextVar==DEFSCRIPT_NONE && VarType==DEFSCRIPT_VAR && !hasVar) // remove brackets in var names, like ${var{ia}ble}
{ {
str.erase(closingBracket,1); str.erase(closingBracket,1);
str.erase(openingBracket,1); str.erase(openingBracket,1);
@ -861,7 +861,7 @@ DefXChgResult DefScriptPackage::ReplaceVars(std::string str, CmdSet *pSet, unsig
std::string subs=vname.substr(1,str.length()-1); std::string subs=vname.substr(1,str.length()-1);
unsigned int vn=atoi( subs.c_str() ); unsigned int vn=atoi( subs.c_str() );
vns << vn; vns << vn;
if(pSet && vns.str()==subs) // resolve arg macros @0 - @99 if(pSet && vns.str()==subs) // resolve arg macros @0 - @4294967295
str=pSet->arg[vn]; str=pSet->arg[vn];
else if(pSet && subs=="def") else if(pSet && subs=="def")
str=pSet->defaultarg; str=pSet->defaultarg;

View File

@ -42,7 +42,7 @@ uint32 SCPDatabase::LoadFromMem(char *buf, uint32 size)
line.clear(); line.clear();
continue; continue;
} }
if(line[line.size()-1] == 13) // this fixes the annoying newline problems on windows + binary mode if(line[line.size()-1] == 13 || line[line.size()-1] == 10) // this fixes the annoying newline problems on windows + binary mode
line[line.size()-1] = 0; line[line.size()-1] = 0;
if(line[0]=='[') if(line[0]=='[')
{ {

View File

@ -93,7 +93,7 @@ float MapTile::GetZ(float x, float y)
return real_z; return real_z;
} }
#ifdef _DEBUG
void MapTile::DebugDumpToFile(void) void MapTile::DebugDumpToFile(void)
{ {
const char *f = "0123456789abcdefghijklmnopqrstuvwxyz"; const char *f = "0123456789abcdefghijklmnopqrstuvwxyz";
@ -125,8 +125,3 @@ void MapTile::DebugDumpToFile(void)
fprintf(fh, out.c_str()); fprintf(fh, out.c_str());
fclose(fh); fclose(fh);
} }
#endif

View File

@ -30,10 +30,7 @@ public:
~MapTile(); ~MapTile();
void ImportFromADT(ADTFile*); void ImportFromADT(ADTFile*);
float GetZ(float,float); float GetZ(float,float);
#ifdef _DEBUG
void DebugDumpToFile(void); void DebugDumpToFile(void);
#endif
private: private:
MapChunk _chunks[256]; // 16x16 MapChunk _chunks[256]; // 16x16