Clean up:

- Add missing ref.
- Add missing f postfix for float value.
- Replace \r\n by \n.
- Restrict variable scope.
This commit is contained in:
Joris 2012-08-31 15:55:58 +02:00
parent 9ba391ceab
commit c0e3fe74f3
5 changed files with 7 additions and 8 deletions

View file

@ -55,7 +55,7 @@ public:
virtual void UpdatePathFinderData(PathFinderInput &input);
virtual bool OnAiHitUnit(CUnit &unit, CUnit *attacker, int /*damage*/);
const Vec2i GetGoalPos() const { return goalPos; }
const Vec2i &GetGoalPos() const { return goalPos; }
bool IsWeakTargetSelected() const;
private:

View file

@ -56,7 +56,7 @@ public:
virtual void OnAnimationAttack(CUnit &unit);
const Vec2i GetGoalPos() const { return goalPos; }
const Vec2i &GetGoalPos() const { return goalPos; }
const SpellType &GetSpell() const { return *Spell; }
void SetSpell(const SpellType &spell) { Spell = &spell; }
private:

View file

@ -126,7 +126,7 @@ class CChunkParticle : public CParticle
{
public:
CChunkParticle(CPosition position, Animation *smokeAnimation, Animation *debrisAnimation,
int minVelocity = 0, int maxVelocity = 400,
int minVelocity = 0, int maxVelocity = 400,
int minTrajectoryAngle = 77, int maxTTL = 0);
virtual ~CChunkParticle();
@ -160,7 +160,7 @@ protected:
class CSmokeParticle : public CParticle
{
public:
CSmokeParticle(CPosition position, Animation *animation, float speedx = 0, float speedy = -22.0);
CSmokeParticle(CPosition position, Animation *animation, float speedx = 0, float speedy = -22.0f);
virtual ~CSmokeParticle();
virtual void draw();

View file

@ -246,8 +246,8 @@ public:
void Clear() {
Name.clear();
ImageFile.clear();
NumTiles = 0;
PixelTileSize.x = PixelTileSize.y = 0;
NumTiles = 0;
PixelTileSize.x = PixelTileSize.y = 0;
delete[] Table;
Table = NULL;
delete[] FlagsTable;

View file

@ -1827,7 +1827,6 @@ void UIHandleButtonUp(unsigned button)
// ALT takes group of unit
// CTRL takes all units of same type (st*rcr*ft)
if (CursorState == CursorStateRectangle && !(MouseButtons & LeftButton)) { // leave select mode
CUnit *unit = NULL;
int num = 0;
//
// Little threshold
@ -1874,7 +1873,7 @@ void UIHandleButtonUp(unsigned button)
// cade: cannot select unit on invisible space
// FIXME: johns: only complete invisibile units
const Vec2i cursorTilePos = UI.MouseViewport->ScreenToTilePos(CursorScreenPos);
CUnit *unit = NULL;
if (Map.IsFieldVisible(*ThisPlayer, cursorTilePos) || ReplayRevealMap) {
const PixelPos cursorMapPos = UI.MouseViewport->ScreenToMapPixelPos(CursorScreenPos);