Fix colobot-lint warnings

1008-fix
krzys-h 2018-04-20 01:31:11 +02:00
parent 1c2bdc9cab
commit e964d3e48c
11 changed files with 24 additions and 16 deletions

View File

@ -44,6 +44,7 @@ CSettings::CSettings()
m_fontSize = 19.0f;
m_windowPos = Math::Point(0.15f, 0.17f);
m_windowDim = Math::Point(0.70f, 0.66f);
m_windowMax = false;
m_IOPublic = false;
m_IODim = Math::Point(320.0f/640.0f, (121.0f+18.0f*8)/480.0f);

View File

@ -146,6 +146,7 @@ CEngine::CEngine(CApplication *app, CSystemUtils* systemUtils)
m_showStats = false;
m_focus = 0.75f;
m_hfov = 2.0f * atan((640.f/480.f) * tan(m_focus / 2.0f));
m_rankView = 0;

View File

@ -518,7 +518,8 @@ void CPlayerProfile::LoadScene(std::string dir)
CLevelParserLine* line = levelParser.Get("Mission");
cat = GetLevelCategoryFromDir(line->GetParam("base")->AsString());
if (dir == "../../crashsave") LoadFinishedLevels(cat);
if (dir == "../../crashsave")
LoadFinishedLevels(cat);
rank = line->GetParam("rank")->AsInt();
if (cat == LevelCategory::CustomLevels)

View File

@ -221,6 +221,8 @@ CRobotMain::CRobotMain()
m_resetCreate = false;
m_shortCut = true;
m_commandHistoryIndex = -1;
m_movieInfoIndex = -1;
m_tooltipPos = Math::Point(0.0f, 0.0f);
@ -4970,7 +4972,8 @@ Error CRobotMain::ProcessEndMissionTake()
text,
details,
false, true,
[&]() {
[&]()
{
ChangePhase(PHASE_WIN);
}
);
@ -5564,13 +5567,13 @@ void CRobotMain::Autosave()
void CRobotMain::QuickSave()
{
GetLogger()->Info("Quicksave!\n");
char infostr[100];
time_t now = time(nullptr);
strftime(infostr, 99, "%y.%m.%d %H:%M", localtime(&now));
std::string info = std::string("[QUICKSAVE]") + infostr;
std::string dir = m_playerProfile->GetSaveFile(std::string("quicksave"));
m_playerProfile->SaveScene(dir, info);
}
@ -5972,12 +5975,12 @@ bool CRobotMain::GetDebugCrashSpheres()
return m_debugCrashSpheres;
}
void CRobotMain::PushToCommandHistory(std::string str)
void CRobotMain::PushToCommandHistory(std::string cmd)
{
if (!m_commandHistory.empty() && m_commandHistory.front() == str) // already in history
if (!m_commandHistory.empty() && m_commandHistory.front() == cmd) // already in history
return;
m_commandHistory.push_front(str);
m_commandHistory.push_front(cmd);
if (m_commandHistory.size() > 50) // to avoid infinite growth
m_commandHistory.pop_back();

View File

@ -528,7 +528,7 @@ protected:
void UpdateDebugCrashSpheres();
//! Adds element to the beginning of command history
void PushToCommandHistory(std::string obj);
void PushToCommandHistory(std::string cmd);
//! Returns next/previous element from command history and updates index
//@{
std::string GetNextFromCommandHistory();

View File

@ -22,10 +22,10 @@
#include "common/restext.h"
#include "common/stringutils.h"
#include "level/parser/parserline.h"
#include "level/robotmain.h"
#include "level/parser/parserline.h"
#include "object/object.h"
#include "ui/displaytext.h"

View File

@ -115,11 +115,11 @@ public:
void AddPoints(int team, int points);
int GetScore(int team);
void SetScore(int team, int score);
void SetScore(int team, int points);
private:
std::vector<std::unique_ptr<CScoreboardKillRule>> m_rulesKill = {};
std::vector<std::unique_ptr<CScoreboardEndTakeRule>> m_rulesEndTake = {};
std::map<int, int> m_score;
int m_finishCounter = 0;
};
};

View File

@ -32,6 +32,7 @@
#include "object/object_create_params.h"
#include "object/object_interface_type.h"
#include "object/object_type.h"
#include "object/interface/destroyable_object.h"
#include <map>

View File

@ -138,6 +138,7 @@ COldObject::COldObject(int id)
m_virusTime = 0.0f;
m_lastVirusParticle = 0.0f;
m_damaging = false;
m_damageTime = 0.0f;
m_dying = DeathType::Alive;
m_bFlat = false;
m_gunGoalV = 0.0f;

View File

@ -591,7 +591,7 @@ bool CScriptFunctions::rResearch(CBotVar* thisclass, CBotVar* var, CBotVar* resu
}
return true;
}
return true;
}
@ -1315,7 +1315,7 @@ bool CScriptFunctions::rBuild(CBotVar* var, CBotVar* result, int& exception, voi
}
}
}
result->SetValInt(err); // indicates the error or ok
result->SetValInt(err); // indicates the error or ok
if ( err != ERR_OK )
{
if ( script->m_errMode == ERM_STOP )
@ -2464,7 +2464,7 @@ bool CScriptFunctions::rFire(CBotVar* var, CBotVar* result, int& exception, void
if ( delay < 0.0f ) delay = -delay;
err = script->m_taskExecutor->StartTaskFire(delay);
}
result->SetValInt(err); // indicates the error or ok
result->SetValInt(err); // indicates the error or ok
if ( err != ERR_OK )
{
script->m_taskExecutor->StopForegroundTask();

View File

@ -1500,7 +1500,7 @@ void CObjectInterface::UpdateInterface(float rTime)
m_lastAlarmTime = 0.0f;
}
}
pg->SetLevel(shield);
pg->SetIcon(icon);
}