From f2ac939e61e60d106165b4ba98f723b63909ebfa Mon Sep 17 00:00:00 2001 From: dteviot Date: Sat, 7 Mar 2015 11:04:54 +1300 Subject: [PATCH] reverted mShouldRepeat back to unsigned char. As recommended by Scrawl. --- apps/esmtool/record.cpp | 4 ++-- apps/openmw/mwgui/windowmanagerimp.cpp | 2 +- apps/openmw/mwmechanics/aisequence.cpp | 2 +- apps/openmw/mwmechanics/aiwander.cpp | 2 +- components/esm/aipackage.hpp | 2 +- components/esm/aisequence.hpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/esmtool/record.cpp b/apps/esmtool/record.cpp index 9e4b1496b..be9b03e80 100644 --- a/apps/esmtool/record.cpp +++ b/apps/esmtool/record.cpp @@ -15,8 +15,8 @@ void printAIPackage(ESM::AIPackage p) std::cout << " Distance: " << p.mWander.mDistance << std::endl; std::cout << " Duration: " << p.mWander.mDuration << std::endl; std::cout << " Time of Day: " << (int)p.mWander.mTimeOfDay << std::endl; - if (!p.mWander.mShouldRepeat) - std::cout << " Should repeat: " << p.mWander.mShouldRepeat << std::endl; + if (p.mWander.mShouldRepeat != 1) + std::cout << " Should repeat: " << (bool)(p.mWander.mShouldRepeat != 0) << std::endl; std::cout << " Idle: "; for (int i = 0; i != 8; i++) diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index bd7e22e7c..d8074a5d8 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -565,7 +565,7 @@ namespace MWGui int eff = mShown & mAllowed & ~mForceHidden; // Show the windows we want - mMap ->setVisible(eff & GW_Map); + mMap ->setVisible((eff & GW_Map) != 0); mStatsWindow ->setVisible((eff & GW_Stats) != 0); mInventoryWindow->setVisible((eff & GW_Inventory) != 0); mInventoryWindow->setGuiMode(mode); diff --git a/apps/openmw/mwmechanics/aisequence.cpp b/apps/openmw/mwmechanics/aisequence.cpp index 533bcd17c..bb078f883 100644 --- a/apps/openmw/mwmechanics/aisequence.cpp +++ b/apps/openmw/mwmechanics/aisequence.cpp @@ -294,7 +294,7 @@ void AiSequence::fill(const ESM::AIPackageList &list) idles.reserve(8); for (int i=0; i<8; ++i) idles.push_back(data.mIdle[i]); - package = new MWMechanics::AiWander(data.mDistance, data.mDuration, data.mTimeOfDay, idles, data.mShouldRepeat); + package = new MWMechanics::AiWander(data.mDistance, data.mDuration, data.mTimeOfDay, idles, data.mShouldRepeat != 0); } else if (it->mType == ESM::AI_Escort) { diff --git a/apps/openmw/mwmechanics/aiwander.cpp b/apps/openmw/mwmechanics/aiwander.cpp index fbb147b34..738facb13 100644 --- a/apps/openmw/mwmechanics/aiwander.cpp +++ b/apps/openmw/mwmechanics/aiwander.cpp @@ -785,7 +785,7 @@ namespace MWMechanics , mDuration(wander->mData.mDuration) , mStartTime(MWWorld::TimeStamp(wander->mStartTime)) , mTimeOfDay(wander->mData.mTimeOfDay) - , mRepeat(wander->mData.mShouldRepeat) + , mRepeat(wander->mData.mShouldRepeat != 0) , mStoredInitialActorPosition(wander->mStoredInitialActorPosition) { if (mStoredInitialActorPosition) diff --git a/components/esm/aipackage.hpp b/components/esm/aipackage.hpp index b164b3d62..5e08806c8 100644 --- a/components/esm/aipackage.hpp +++ b/components/esm/aipackage.hpp @@ -32,7 +32,7 @@ namespace ESM short mDuration; unsigned char mTimeOfDay; unsigned char mIdle[8]; - bool mShouldRepeat; + unsigned char mShouldRepeat; }; struct AITravel diff --git a/components/esm/aisequence.hpp b/components/esm/aisequence.hpp index c2142ab34..2560fbe7d 100644 --- a/components/esm/aisequence.hpp +++ b/components/esm/aisequence.hpp @@ -44,7 +44,7 @@ namespace ESM short mDuration; unsigned char mTimeOfDay; unsigned char mIdle[8]; - bool mShouldRepeat; + unsigned char mShouldRepeat; }; struct AiTravelData {