1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 03:45:32 +00:00

Merge pull request #2002 from akortunov/warningfix

Fix Clang warnings
This commit is contained in:
Bret Curtis 2018-10-31 08:26:50 +01:00 committed by GitHub
commit 341c6d571d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 75 additions and 79 deletions

View file

@ -54,71 +54,71 @@ namespace MWMechanics
MechanicsManager();
virtual void add (const MWWorld::Ptr& ptr);
virtual void add (const MWWorld::Ptr& ptr) override;
///< Register an object for management
virtual void remove (const MWWorld::Ptr& ptr);
virtual void remove (const MWWorld::Ptr& ptr) override;
///< Deregister an object for management
virtual void updateCell(const MWWorld::Ptr &old, const MWWorld::Ptr &ptr);
virtual void updateCell(const MWWorld::Ptr &old, const MWWorld::Ptr &ptr) override;
///< Moves an object to a new cell
virtual void drop(const MWWorld::CellStore *cellStore);
virtual void drop(const MWWorld::CellStore *cellStore) override;
///< Deregister all objects in the given cell.
virtual void watchActor(const MWWorld::Ptr& ptr);
virtual void watchActor(const MWWorld::Ptr& ptr) override;
///< On each update look for changes in a previously registered actor and update the
/// GUI accordingly.
virtual void update (float duration, bool paused);
virtual void update (float duration, bool paused) override;
///< Update objects
///
/// \param paused In game type does not currently advance (this usually means some GUI
/// component is up).
virtual void advanceTime (float duration);
virtual void advanceTime (float duration) override;
virtual void setPlayerName (const std::string& name);
virtual void setPlayerName (const std::string& name) override;
///< Set player name.
virtual void setPlayerRace (const std::string& id, bool male, const std::string &head, const std::string &hair);
virtual void setPlayerRace (const std::string& id, bool male, const std::string &head, const std::string &hair) override;
///< Set player race.
virtual void setPlayerBirthsign (const std::string& id);
virtual void setPlayerBirthsign (const std::string& id) override;
///< Set player birthsign.
virtual void setPlayerClass (const std::string& id);
virtual void setPlayerClass (const std::string& id) override;
///< Set player class to stock class.
virtual void setPlayerClass (const ESM::Class& class_);
virtual void setPlayerClass (const ESM::Class& class_) override;
///< Set player class to custom class.
virtual void restoreDynamicStats(MWWorld::Ptr actor, bool sleep);
virtual void restoreDynamicStats(MWWorld::Ptr actor, bool sleep) override;
virtual void rest(bool sleep);
virtual void rest(bool sleep) override;
///< If the player is sleeping or waiting, this should be called every hour.
/// @param sleep is the player sleeping or waiting?
virtual int getHoursToRest() const;
virtual int getHoursToRest() const override;
///< Calculate how many hours the player needs to rest in order to be fully healed
virtual int getBarterOffer(const MWWorld::Ptr& ptr,int basePrice, bool buying);
virtual int getBarterOffer(const MWWorld::Ptr& ptr,int basePrice, bool buying) override;
///< This is used by every service to determine the price of objects given the trading skills of the player and NPC.
virtual int getDerivedDisposition(const MWWorld::Ptr& ptr, bool addTemporaryDispositionChange = true);
virtual int getDerivedDisposition(const MWWorld::Ptr& ptr, bool addTemporaryDispositionChange = true) override;
///< Calculate the diposition of an NPC toward the player.
virtual int countDeaths (const std::string& id) const;
virtual int countDeaths (const std::string& id) const override;
///< Return the number of deaths for actors with the given ID.
virtual void getPersuasionDispositionChange (const MWWorld::Ptr& npc, PersuasionType type, bool& success, float& tempChange, float& permChange);
virtual void getPersuasionDispositionChange (const MWWorld::Ptr& npc, PersuasionType type, bool& success, float& tempChange, float& permChange) override;
///< Perform a persuasion action on NPC
/// Check if \a observer is potentially aware of \a ptr. Does not do a line of sight check!
virtual bool awarenessCheck (const MWWorld::Ptr& ptr, const MWWorld::Ptr& observer);
virtual bool awarenessCheck (const MWWorld::Ptr& ptr, const MWWorld::Ptr& observer) override;
/// Makes \a ptr fight \a target. Also shouts a combat taunt.
virtual void startCombat (const MWWorld::Ptr& ptr, const MWWorld::Ptr& target);
virtual void startCombat (const MWWorld::Ptr& ptr, const MWWorld::Ptr& target) override;
/**
* @note victim may be empty
@ -128,126 +128,119 @@ namespace MWMechanics
* @return was the crime seen?
*/
virtual bool commitCrime (const MWWorld::Ptr& ptr, const MWWorld::Ptr& victim,
OffenseType type, int arg=0, bool victimAware=false);
OffenseType type, int arg=0, bool victimAware=false) override;
/// @return false if the attack was considered a "friendly hit" and forgiven
virtual bool actorAttacked (const MWWorld::Ptr& victim, const MWWorld::Ptr& attacker);
virtual bool actorAttacked (const MWWorld::Ptr& victim, const MWWorld::Ptr& attacker) override;
/// Notify that actor was killed, add a murder bounty if applicable
/// @note No-op for non-player attackers
virtual void actorKilled (const MWWorld::Ptr& victim, const MWWorld::Ptr& attacker);
/// Checks if commiting a crime is currently valid
/// @param victim The actor being attacked
/// @param attacker The actor commiting the crime
/// @return true if the victim is a valid target for crime
virtual bool canCommitCrimeAgainst(const MWWorld::Ptr& victim, const MWWorld::Ptr& attacker);
virtual void actorKilled (const MWWorld::Ptr& victim, const MWWorld::Ptr& attacker) override;
/// Utility to check if taking this item is illegal and calling commitCrime if so
/// @param container The container the item is in; may be empty for an item in the world
virtual void itemTaken (const MWWorld::Ptr& ptr, const MWWorld::Ptr& item, const MWWorld::Ptr& container,
int count, bool alarm = true);
int count, bool alarm = true) override;
/// Utility to check if opening (i.e. unlocking) this object is illegal and calling commitCrime if so
virtual void objectOpened (const MWWorld::Ptr& ptr, const MWWorld::Ptr& item);
virtual void objectOpened (const MWWorld::Ptr& ptr, const MWWorld::Ptr& item) override;
/// Attempt sleeping in a bed. If this is illegal, call commitCrime.
/// @return was it illegal, and someone saw you doing it? Also returns fail when enemies are nearby
virtual bool sleepInBed (const MWWorld::Ptr& ptr, const MWWorld::Ptr& bed);
virtual bool sleepInBed (const MWWorld::Ptr& ptr, const MWWorld::Ptr& bed) override;
virtual void forceStateUpdate(const MWWorld::Ptr &ptr);
virtual void forceStateUpdate(const MWWorld::Ptr &ptr) override;
/// Attempt to play an animation group
/// @return Success or error
virtual bool playAnimationGroup(const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number, bool persist=false);
virtual void skipAnimation(const MWWorld::Ptr& ptr);
virtual bool checkAnimationPlaying(const MWWorld::Ptr& ptr, const std::string &groupName);
virtual void persistAnimationStates();
virtual bool playAnimationGroup(const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number, bool persist=false) override;
virtual void skipAnimation(const MWWorld::Ptr& ptr) override;
virtual bool checkAnimationPlaying(const MWWorld::Ptr& ptr, const std::string &groupName) override;
virtual void persistAnimationStates() override;
/// Update magic effects for an actor. Usually done automatically once per frame, but if we're currently
/// paused we may want to do it manually (after equipping permanent enchantment)
virtual void updateMagicEffects (const MWWorld::Ptr& ptr);
virtual void updateMagicEffects (const MWWorld::Ptr& ptr) override;
virtual void getObjectsInRange (const osg::Vec3f& position, float radius, std::vector<MWWorld::Ptr>& objects);
virtual void getActorsInRange(const osg::Vec3f &position, float radius, std::vector<MWWorld::Ptr> &objects);
virtual void getObjectsInRange (const osg::Vec3f& position, float radius, std::vector<MWWorld::Ptr>& objects) override;
virtual void getActorsInRange(const osg::Vec3f &position, float radius, std::vector<MWWorld::Ptr> &objects) override;
/// Check if there are actors in selected range
virtual bool isAnyActorInRange(const osg::Vec3f &position, float radius);
virtual bool isAnyActorInRange(const osg::Vec3f &position, float radius) override;
virtual std::list<MWWorld::Ptr> getActorsSidingWith(const MWWorld::Ptr& actor);
virtual std::list<MWWorld::Ptr> getActorsFollowing(const MWWorld::Ptr& actor);
virtual std::list<int> getActorsFollowingIndices(const MWWorld::Ptr& actor);
virtual std::list<MWWorld::Ptr> getActorsSidingWith(const MWWorld::Ptr& actor) override;
virtual std::list<MWWorld::Ptr> getActorsFollowing(const MWWorld::Ptr& actor) override;
virtual std::list<int> getActorsFollowingIndices(const MWWorld::Ptr& actor) override;
virtual std::list<MWWorld::Ptr> getActorsFighting(const MWWorld::Ptr& actor);
virtual std::list<MWWorld::Ptr> getEnemiesNearby(const MWWorld::Ptr& actor);
virtual std::list<MWWorld::Ptr> getActorsFighting(const MWWorld::Ptr& actor) override;
virtual std::list<MWWorld::Ptr> getEnemiesNearby(const MWWorld::Ptr& actor) override;
/// Recursive version of getActorsFollowing
virtual void getActorsFollowing(const MWWorld::Ptr& actor, std::set<MWWorld::Ptr>& out);
virtual void getActorsFollowing(const MWWorld::Ptr& actor, std::set<MWWorld::Ptr>& out) override;
/// Recursive version of getActorsSidingWith
virtual void getActorsSidingWith(const MWWorld::Ptr& actor, std::set<MWWorld::Ptr>& out);
virtual void getActorsSidingWith(const MWWorld::Ptr& actor, std::set<MWWorld::Ptr>& out) override;
virtual bool toggleAI();
virtual bool isAIActive();
virtual bool toggleAI() override;
virtual bool isAIActive() override;
virtual void playerLoaded();
virtual void playerLoaded() override;
virtual int countSavedGameRecords() const;
virtual int countSavedGameRecords() const override;
virtual void write (ESM::ESMWriter& writer, Loading::Listener& listener) const;
virtual void write (ESM::ESMWriter& writer, Loading::Listener& listener) const override;
virtual void readRecord (ESM::ESMReader& reader, uint32_t type);
virtual void readRecord (ESM::ESMReader& reader, uint32_t type) override;
virtual void clear();
virtual void clear() override;
virtual bool isAggressive (const MWWorld::Ptr& ptr, const MWWorld::Ptr& target);
virtual bool isAggressive (const MWWorld::Ptr& ptr, const MWWorld::Ptr& target) override;
virtual void keepPlayerAlive();
virtual void keepPlayerAlive() override;
virtual bool isCastingSpell (const MWWorld::Ptr& ptr) const;
virtual bool isCastingSpell (const MWWorld::Ptr& ptr) const override;
virtual bool isReadyToBlock (const MWWorld::Ptr& ptr) const;
virtual bool isReadyToBlock (const MWWorld::Ptr& ptr) const override;
/// Is \a ptr casting spell or using weapon now?
virtual bool isAttackingOrSpell(const MWWorld::Ptr &ptr) const;
virtual bool isAttackingOrSpell(const MWWorld::Ptr &ptr) const override;
virtual void castSpell(const MWWorld::Ptr& ptr, const std::string spellId, bool manualSpell=false);
virtual void castSpell(const MWWorld::Ptr& ptr, const std::string spellId, bool manualSpell=false) override;
void processChangedSettings(const Settings::CategorySettingVector& settings) override;
virtual float getActorsProcessingRange() const;
virtual float getActorsProcessingRange() const override;
/// Check if the target actor was detected by an observer
/// If the observer is a non-NPC, check all actors in AI processing distance as observers
virtual bool isActorDetected(const MWWorld::Ptr& actor, const MWWorld::Ptr& observer);
virtual bool isActorDetected(const MWWorld::Ptr& actor, const MWWorld::Ptr& observer) override;
virtual void confiscateStolenItems (const MWWorld::Ptr& player, const MWWorld::Ptr& targetContainer);
virtual void confiscateStolenItems (const MWWorld::Ptr& player, const MWWorld::Ptr& targetContainer) override;
/// List the owners that the player has stolen this item from (the owner can be an NPC or a faction).
/// <Owner, item count>
virtual std::vector<std::pair<std::string, int> > getStolenItemOwners(const std::string& itemid);
virtual std::vector<std::pair<std::string, int> > getStolenItemOwners(const std::string& itemid) override;
/// Has the player stolen this item from the given owner?
virtual bool isItemStolenFrom(const std::string& itemid, const MWWorld::Ptr& ptr);
virtual bool isItemStolenFrom(const std::string& itemid, const MWWorld::Ptr& ptr) override;
virtual bool isBoundItem(const MWWorld::Ptr& item);
virtual bool isBoundItem(const MWWorld::Ptr& item) override;
/// @return is \a ptr allowed to take/use \a target or is it a crime?
virtual bool isAllowedToUse (const MWWorld::Ptr& ptr, const MWWorld::Ptr& target, MWWorld::Ptr& victim);
virtual bool isAllowedToUse (const MWWorld::Ptr& ptr, const MWWorld::Ptr& target, MWWorld::Ptr& victim) override;
virtual void setWerewolf(const MWWorld::Ptr& actor, bool werewolf);
virtual void applyWerewolfAcrobatics(const MWWorld::Ptr& actor);
virtual void setWerewolf(const MWWorld::Ptr& actor, bool werewolf) override;
virtual void applyWerewolfAcrobatics(const MWWorld::Ptr& actor) override;
virtual void cleanupSummonedCreature(const MWWorld::Ptr& caster, int creatureActorId);
virtual void cleanupSummonedCreature(const MWWorld::Ptr& caster, int creatureActorId) override;
virtual void confiscateStolenItemToOwner(const MWWorld::Ptr &player, const MWWorld::Ptr &item, const MWWorld::Ptr& victim, int count);
virtual void confiscateStolenItemToOwner(const MWWorld::Ptr &player, const MWWorld::Ptr &item, const MWWorld::Ptr& victim, int count) override;
virtual bool isAttackPreparing(const MWWorld::Ptr& ptr);
virtual bool isRunning(const MWWorld::Ptr& ptr);
virtual bool isSneaking(const MWWorld::Ptr& ptr);
virtual bool isAttackPreparing(const MWWorld::Ptr& ptr) override;
virtual bool isRunning(const MWWorld::Ptr& ptr) override;
virtual bool isSneaking(const MWWorld::Ptr& ptr) override;
private:
bool canCommitCrimeAgainst(const MWWorld::Ptr& victim, const MWWorld::Ptr& attacker);
bool canReportCrime(const MWWorld::Ptr &actor, const MWWorld::Ptr &victim, std::set<MWWorld::Ptr> &playerFollowers);
bool reportCrime (const MWWorld::Ptr& ptr, const MWWorld::Ptr& victim,
OffenseType type, int arg=0);
};
}

View file

@ -17,7 +17,8 @@ namespace DetourNavigator
inline std::ostream& operator <<(std::ostream& stream, const Flag value)
{
switch (value) {
switch (value)
{
case Flag_none:
return stream << "none";
case Flag_walk:
@ -27,6 +28,8 @@ namespace DetourNavigator
case Flag_openDoor:
return stream << "openDoor";
}
return stream;
}
struct WriteFlags