* 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:
parent
f4829928e8
commit
993bc000df
@ -810,7 +810,7 @@ DefXChgResult DefScriptPackage::ReplaceVars(std::string str, CmdSet *pSet, unsig
|
||||
if(!bracketsOpen)
|
||||
{
|
||||
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(openingBracket,1);
|
||||
@ -861,7 +861,7 @@ DefXChgResult DefScriptPackage::ReplaceVars(std::string str, CmdSet *pSet, unsig
|
||||
std::string subs=vname.substr(1,str.length()-1);
|
||||
unsigned int vn=atoi( subs.c_str() );
|
||||
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];
|
||||
else if(pSet && subs=="def")
|
||||
str=pSet->defaultarg;
|
||||
|
||||
@ -42,7 +42,7 @@ uint32 SCPDatabase::LoadFromMem(char *buf, uint32 size)
|
||||
line.clear();
|
||||
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;
|
||||
if(line[0]=='[')
|
||||
{
|
||||
|
||||
@ -93,7 +93,7 @@ float MapTile::GetZ(float x, float y)
|
||||
|
||||
return real_z;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void MapTile::DebugDumpToFile(void)
|
||||
{
|
||||
const char *f = "0123456789abcdefghijklmnopqrstuvwxyz";
|
||||
@ -125,8 +125,3 @@ void MapTile::DebugDumpToFile(void)
|
||||
fprintf(fh, out.c_str());
|
||||
fclose(fh);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -30,10 +30,7 @@ public:
|
||||
~MapTile();
|
||||
void ImportFromADT(ADTFile*);
|
||||
float GetZ(float,float);
|
||||
|
||||
#ifdef _DEBUG
|
||||
void DebugDumpToFile(void);
|
||||
#endif
|
||||
|
||||
private:
|
||||
MapChunk _chunks[256]; // 16x16
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user