bool version_mismatch = flags & 2;
bool version_check = flags & 4;
MapInfo_Map_titlestring = ReadString();
+ MapInfo_Map_author = flags & 8 ? ReadString() : "";
srv_minplayers = ReadByte();
srv_maxplayers = ReadByte();
string modifications = translate_modifications(ReadString());
msg = strcat(msg, "\n\n", _("Gametype:"), " ^1", MapInfo_Type_ToText(gametype), "\n");
msg = strcat(msg, "\n", _("Map:"), " ", MapInfo_Map_titlestring, "\n");
+ if (flags & 8)
+ msg = strcat(msg, "^9", _("by:"), " ", MapInfo_Map_author, "\n");
if (srv_minplayers || srv_maxplayers)
{
MapInfo_Map_author = substring(title, offset + 4, strlen(title) - (offset + 4));
title = substring(title, 0, offset);
}
+ else if ((offset = strstrofs(title, " (by ", 0)) >= 0 || (offset = strstrofs(title, " [by ", 0)) >= 0)
+ {
+ if (MapInfo_Map_author == "<AUTHOR>")
+ MapInfo_Map_author = substring(title, offset + 5, strlen(title) - (offset + 5) - 1);
+ title = substring(title, 0, offset);
+ }
+ else if ((offset = strstrofs(title, "Made By ", 0)) >= 0) // often at the start of the string
+ {
+ if (MapInfo_Map_author == "<AUTHOR>")
+ MapInfo_Map_author = substring(title, offset + 8, strlen(title) - (offset + 8));
+ title = substring(title, 0, offset);
+ }
return title != "" ? title : "<TITLE>";
}
MapInfo_Map_description = stored_Map_description;
if(stored_Map_title != "")
MapInfo_Map_title = stored_Map_title;
- MapInfo_Map_author = stored_Map_author;
+ if(stored_Map_author != "") // write the usual "<AUTHOR>" if we have nothing better
+ MapInfo_Map_author = stored_Map_author;
// might have .arena AND .defi for the same map so these bitfields are OR'd
if(isgenerator)
MapInfo_Map_supportedGametypes |= stored_supportedGametypes;
if (MapInfo_Map_title == "<TITLE>")
if (world.message != "")
MapInfo_Map_title = world.message;
+ if (MapInfo_Map_author == "<AUTHOR>")
+ if ((s = GetField_fullspawndata(world, "author")) != "")
+ MapInfo_Map_author = s;
}
#endif
// Could skip removing author from title when it's source is .mapinfo
else
MapInfo_Map_titlestring = sprintf("^2%s ^7// ^2%s", MapInfo_Map_bspname, MapInfo_Map_title);
+ if (MapInfo_Map_author == "<AUTHOR>")
+ MapInfo_Map_author = ""; // don't display "<AUTHOR>" in the UI (we do write it to .mapinfo files)
+
MapInfo_Cache_Store();
if(MapInfo_Map_supportedGametypes != 0)
return r;
if (CS(this).version < autocvar_gameversion)
flags |= 4;
MapInfo_Get_ByName(mi_shortname, 0, NULL);
+ if (MapInfo_Map_author != "")
+ flags |= 8;
WriteByte(msg_type, flags);
WriteString(msg_type, autocvar_hostname);
WriteString(msg_type, autocvar_g_xonoticversion);
WriteString(msg_type, MapInfo_Map_titlestring);
+ if (flags & 8)
+ WriteString(msg_type, MapInfo_Map_author);
MapInfo_ClearTemps();
WriteByte(msg_type, autocvar_g_warmup > 1 ? autocvar_g_warmup : map_minplayers);