diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-06-02 00:32:53 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-06-02 16:41:47 +0200 |
commit | 4e27937924766948d7ff9200f04a37fe4d59018c (patch) | |
tree | c1f5c255192c85a82c77c2f8f916984e2b863c44 /src/being.cpp | |
parent | c2eab288ecc7d7c5e26d02ccecf285cbc0c218ed (diff) | |
download | mana-4e27937924766948d7ff9200f04a37fe4d59018c.tar.gz mana-4e27937924766948d7ff9200f04a37fe4d59018c.tar.bz2 mana-4e27937924766948d7ff9200f04a37fe4d59018c.tar.xz mana-4e27937924766948d7ff9200f04a37fe4d59018c.zip |
Arbitrary code cleanups
Just some stuff that piles up while "looking" at the code, which
eventually gets annoying to ignore while staging real changes.
* Replaced a few NULL occurrences with 0
* Rely on default parameter for std::vector::resize.
* Replaced a few "" with std::string()
* Prefer .empty() to == ""
* Removed a few comparisons with NULL
* Don't check pointers before deleting them
* Removed a bunch of redundant semicolons
* Made some global variables static (local to their compilation unit)
* Prefer prefix ++/-- operators to postfix versions when possible
* Corrected location of a comment
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/being.cpp b/src/being.cpp index a307ddc1..9c50ca1d 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -1061,10 +1061,10 @@ void Being::setSprite(unsigned int slot, int id, const std::string &color, ensureSize(slot + 1); if (slot >= mSpriteIDs.size()) - mSpriteIDs.resize(slot + 1, 0); + mSpriteIDs.resize(slot + 1); if (slot >= mSpriteColors.size()) - mSpriteColors.resize(slot + 1, ""); + mSpriteColors.resize(slot + 1); // id = 0 means unequip if (id == 0) @@ -1072,12 +1072,12 @@ void Being::setSprite(unsigned int slot, int id, const std::string &color, removeSprite(slot); if (isWeapon) - mEquippedWeapon = NULL; + mEquippedWeapon = 0; } else { std::string filename = itemDb->get(id).getSprite(mGender); - AnimatedSprite *equipmentSprite = NULL; + AnimatedSprite *equipmentSprite = 0; if (!filename.empty()) { |