Added areCellsFree function

This commit is contained in:
mathusummut
2019-02-06 19:19:10 +01:00
parent a1a62b40ce
commit 5c7180b750
8 changed files with 14 additions and 17 deletions

View File

@@ -39,7 +39,7 @@ namespace Game {
const char *mailString = "https://github.com/Glest";
string getCrashDumpFileName() {
return GameVersionString + ".dmp";
return "glest.dmp";
}
string getPlatformTypeNameString() {
static string platform;

View File

@@ -2454,13 +2454,12 @@ namespace Game {
}
bool
ScriptManager::areCellsFree(Vec2i pos, int size, int field) {
ScriptManager::areCellsFree(int size, int field, Vec2i pos) {
if (SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled)
SystemFlags::OutputDebug(SystemFlags::debugLUA,
"In [%s::%s Line: %d]\n",
extractFileFromDirectoryPath(__FILE__).
c_str(), __FUNCTION__, __LINE__);
return world->areCellsFree(pos, size, static_cast<Field>(field));
}
@@ -4485,7 +4484,7 @@ namespace Game {
luaArguments(luaHandle);
try {
bool result = thisScriptManager->areCellsFree(luaArguments.getVec2i(-3), luaArguments.getInt(-2), luaArguments.getInt(-1));
bool result = thisScriptManager->areCellsFree(luaArguments.getInt(-3), luaArguments.getInt(-2), luaArguments.getVec2i(-1));
luaArguments.returnInt(result ? 1 : 0);
} catch (const game_runtime_error & ex) {
error(luaHandle, &ex, __FILE__, __FUNCTION__, __LINE__);

View File

@@ -630,7 +630,7 @@ namespace Game {
Vec2i
getUnitPosition(int unitId);
bool
areCellsFree(Vec2i pos, int size, int field);
areCellsFree(int size, int field, Vec2i pos);
int
getUnitFaction(int unitId);
const string

View File

@@ -1730,7 +1730,7 @@ namespace Game {
properties.
getString(string
("FactionTypeNameForIndex")
+ intToStr(i), "?"));
+ intToStr(i), "Unknown"));
if (SystemFlags::getSystemSettingType(SystemFlags::debugSystem).
enabled)

View File

@@ -7364,11 +7364,11 @@ namespace Game {
if (GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
infoStr += lang.getString("OpenGlInfo") + ":\n";
infoStr += " " + lang.getString("OpenGlVersion") + ": ";
infoStr += string((getGlVersion() != NULL ? getGlVersion() : "?")) + "\n";
infoStr += string((getGlVersion() != NULL ? getGlVersion() : "unknown")) + "\n";
infoStr += " " + lang.getString("OpenGlRenderer") + ": ";
infoStr += string((getGlVersion() != NULL ? getGlVersion() : "?")) + "\n";
infoStr += string((getGlVersion() != NULL ? getGlVersion() : "unknown")) + "\n";
infoStr += " " + lang.getString("OpenGlVendor") + ": ";
infoStr += string((getGlVendor() != NULL ? getGlVendor() : "?")) + "\n";
infoStr += string((getGlVendor() != NULL ? getGlVendor() : "unknown")) + "\n";
infoStr += " " + lang.getString("OpenGlMaxLights") + ": ";
infoStr += intToStr(getGlMaxLights()) + "\n";
infoStr += " " + lang.getString("OpenGlMaxTextureSize") + ": ";

View File

@@ -380,7 +380,7 @@ namespace Game {
labelMapInfo.registerGraphicComponent(containerName, "labelMapInfo");
labelMapInfo.init(xoffset + 100, mapPos - labelOffset - 10, 200, 40);
labelMapInfo.setText("?");
labelMapInfo.setText("");
labelMap.registerGraphicComponent(containerName, "labelMap");
labelMap.init(xoffset + 100, mapHeadPos);

View File

@@ -865,17 +865,15 @@ namespace Game {
char szMsg[8096] = "";
snprintf(szMsg, 8096,
"A new update was detected: %s\nUpdate Date: %s\nPlease visit glest.github.io for details!",
props.getString("LatestGameVersion", "?").c_str(),
props.getString("LatestGameVersionReleaseDate",
"?").c_str());
props.getString("LatestGameVersion", "unknown").c_str(),
props.getString("LatestGameVersionReleaseDate", "unknown").c_str());
showFTPMessageBox(szMsg, "Update", false, true);
} else {
char szMsg[8096] = "";
snprintf(szMsg, 8096,
"A new update was detected: %s\nUpdate Date: %s\nDownload update now?",
props.getString("LatestGameVersion", "?").c_str(),
props.getString("LatestGameVersionReleaseDate",
"?").c_str());
props.getString("LatestGameVersion", "unknown").c_str(),
props.getString("LatestGameVersionReleaseDate", "unknown").c_str());
showFTPMessageBox(szMsg, "Update", false, false);
}
}

View File

@@ -144,7 +144,7 @@ namespace Game {
externalconnectport = value;
}
void setCountry(string value) {
country = value;
country = value == "??" ? "" : value;
}
void setStatus(int value) {
status = value;