Skip to content

Commit

Permalink
Creature::isFlagBitSet() changed to free function.
Browse files Browse the repository at this point in the history
  • Loading branch information
dteviot committed Aug 28, 2015
1 parent 95d2d82 commit 300c483
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
11 changes: 5 additions & 6 deletions apps/openmw/mwclass/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ namespace
cloned->mContainerStore = mContainerStore->clone();
return cloned;
}

bool isFlagBitSet(const MWWorld::Ptr &ptr, ESM::Creature::Flags bitMask)
{
return (ptr.get<ESM::Creature>()->mBase->mFlags & bitMask) != 0;
}
}

namespace MWClass
Expand Down Expand Up @@ -774,10 +779,4 @@ namespace MWClass
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
scale *= ref->mBase->mScale;
}

bool Creature::isFlagBitSet(const MWWorld::Ptr &ptr, ESM::Creature::Flags bitMask) const
{
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
return (ref->mBase->mFlags & bitMask) != 0;
}
}
7 changes: 0 additions & 7 deletions apps/openmw/mwclass/creature.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef GAME_MWCLASS_CREATURE_H
#define GAME_MWCLASS_CREATURE_H

#include <components/esm/loadcrea.hpp>

#include "actor.hpp"

namespace ESM
Expand Down Expand Up @@ -136,11 +134,6 @@ namespace MWClass
virtual int getBaseFightRating(const MWWorld::Ptr &ptr) const;

virtual void adjustScale(const MWWorld::Ptr& ptr, osg::Vec3f& scale) const;

private:

/// \return true if any of the indicated bits in Creature's mFlags is set
bool isFlagBitSet(const MWWorld::Ptr &ptr, ESM::Creature::Flags bitMask) const;
};
}

Expand Down

0 comments on commit 300c483

Please sign in to comment.