if (world.message != "")
MapInfo_Map_title = world.message;
if (MapInfo_Map_author == "<AUTHOR>")
- if ((s = GetField_fullspawndata(world, "author")) != "")
+ if ((s = GetField_fullspawndata(world, "author", false)) != "")
MapInfo_Map_author = s;
}
#endif
if (!this.team)
{
- string t = GetField_fullspawndata(this, "team");
+ string t = GetField_fullspawndata(this, "team", false);
// bones_was_here: same hack as used to support teamed items on Q3 maps
if (t) this.team = crc16(false, t);
}
this.reset = target_speed_reset;
// support a 0 speed setting AND a default
- string s = GetField_fullspawndata(this, "speed");
+ string s = GetField_fullspawndata(this, "speed", false);
if (!s || s == "")
this.speed = 100;
// Xonotic is usually played with a CPM-based physics so we default to CPM mode
if(cvar_string("g_mod_physics") == "Q3")
{
- if(stof(GetField_fullspawndata(this, "notvq3")))
+ if(stof(GetField_fullspawndata(this, "notvq3", false)))
return true;
}
- else if(stof(GetField_fullspawndata(this, "notcpm")))
+ else if(stof(GetField_fullspawndata(this, "notcpm", false)))
return true;
// Q3 mappers use "notq3a" or "notta" to disable an entity in Q3A or Q3TA
// Xonotic has ~equivalent features to Team Arena
- if(stof(GetField_fullspawndata(this, "notta")))
+ if(stof(GetField_fullspawndata(this, "notta", false)))
return true;
// FIXME: singleplayer does not use maxclients 1 as that would prevent bots,
// this is the case in Q3 also, it uses another method to block clients.
// Only accessible in VQ3, via the `spmap` command.
- if(stof(GetField_fullspawndata(this, "notsingle")))
+ if(stof(GetField_fullspawndata(this, "notsingle", false)))
if(maxclients == 1 && IS_GAMETYPE(DEATHMATCH))
return true;
- if(stof(GetField_fullspawndata(this, "notteam")))
+ if(stof(GetField_fullspawndata(this, "notteam", false)))
if(teamplay)
return true;
- if(stof(GetField_fullspawndata(this, "notfree")))
+ if(stof(GetField_fullspawndata(this, "notfree", false)))
if(!teamplay)
return true;
{
if (!this.team)
{
- string t = GetField_fullspawndata(this, "team");
+ string t = GetField_fullspawndata(this, "team", false);
// bones_was_here: this hack is cheaper than changing to a .string strcmp()
if(t) this.team = crc16(false, t);
}
}
}
-/** Retrieves the value of a map entity field from fullspawndata
+/** Retrieves the value of a map entity field from fullspawndata.
* This bypasses field value changes made by the engine,
* eg string-to-float and escape sequence substitution.
*
*
* Returns the last instance of the field to match DarkPlaces behaviour.
*
- * Path support: converts \ to / and tests the file if a third (bool, true) arg is passed.
+ * Path support: converts \ to / and checks the file exists, if vfspath is true.
* Returns string_null if the entity does not have the field, or the file is not in the VFS.
*
* FIXME: entities with //comments are not supported.
*/
-string GetField_fullspawndata(entity e, string f, ...)
+string GetField_fullspawndata(entity e, string fieldname, bool vfspath)
{
string v = string_null;
return v;
}
- //print(sprintf("%s(EDICT %s, FIELD %s)\n", __FUNC__, ftos(num_for_edict(e)), f));
+ //print(sprintf("%s(EDICT %s, FIELD %s)\n", __FUNC__, ftos(num_for_edict(e)), fieldname));
//print(strcat("FULLSPAWNDATA:", e.fullspawndata, "\n"));
// tokenize treats \ as an escape, but tokenize_console returns the required literal
for (int t = tokenize_console(e.fullspawndata) - 3; t > 0; t -= 2)
{
//print(sprintf("\tTOKEN %s:%s\t%s:%s\n", ftos(t), ftos(t + 1), argv(t), argv(t + 1)));
- if (argv(t) == f)
+ if (argv(t) == fieldname)
{
v = argv(t + 1);
break;
//print(strcat("RESULT: ", v, "\n\n"));
- if (v && ...(0, bool) == true)
+ if (v && vfspath)
{
v = strreplace("\\", "/", v);
if (whichpack(v) == "")
.float contents_damagetime;
-string GetField_fullspawndata(entity e, string f, ...);
+string GetField_fullspawndata(entity e, string fieldname, bool vfspath);
/*
==================