mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
Fix display for some package settings
This commit is contained in:
parent
16922f8000
commit
e537f2b6f3
@ -19,7 +19,7 @@ void printAIPackage(const ESM::AIPackage& p)
|
||||
std::cout << " Duration: " << p.mWander.mDuration << std::endl;
|
||||
std::cout << " Time of Day: " << (int)p.mWander.mTimeOfDay << std::endl;
|
||||
if (p.mWander.mShouldRepeat != 1)
|
||||
std::cout << " Should repeat: " << (bool)(p.mWander.mShouldRepeat != 0) << std::endl;
|
||||
std::cout << " Should repeat: " << static_cast<bool>(p.mWander.mShouldRepeat != 0) << std::endl;
|
||||
|
||||
std::cout << " Idle: ";
|
||||
for (int i = 0; i != 8; i++)
|
||||
@ -30,7 +30,7 @@ void printAIPackage(const ESM::AIPackage& p)
|
||||
{
|
||||
std::cout << " Travel Coordinates: (" << p.mTravel.mX << ","
|
||||
<< p.mTravel.mY << "," << p.mTravel.mZ << ")" << std::endl;
|
||||
std::cout << " Should repeat: " << p.mTravel.mShouldRepeat << std::endl;
|
||||
std::cout << " Should repeat: " << static_cast<bool>(p.mTravel.mShouldRepeat != 0) << std::endl;
|
||||
}
|
||||
else if (p.mType == ESM::AI_Follow || p.mType == ESM::AI_Escort)
|
||||
{
|
||||
@ -38,12 +38,12 @@ void printAIPackage(const ESM::AIPackage& p)
|
||||
<< p.mTarget.mY << "," << p.mTarget.mZ << ")" << std::endl;
|
||||
std::cout << " Duration: " << p.mTarget.mDuration << std::endl;
|
||||
std::cout << " Target ID: " << p.mTarget.mId.toString() << std::endl;
|
||||
std::cout << " Should repeat: " << p.mTarget.mShouldRepeat << std::endl;
|
||||
std::cout << " Should repeat: " << static_cast<bool>(p.mTarget.mShouldRepeat != 0) << std::endl;
|
||||
}
|
||||
else if (p.mType == ESM::AI_Activate)
|
||||
{
|
||||
std::cout << " Name: " << p.mActivate.mName.toString() << std::endl;
|
||||
std::cout << " Should repeat: " << p.mActivate.mShouldRepeat << std::endl;
|
||||
std::cout << " Should repeat: " << static_cast<bool>(p.mActivate.mShouldRepeat != 0) << std::endl;
|
||||
}
|
||||
else {
|
||||
std::cout << " BadPackage: " << Misc::StringUtils::format("0x%08X", p.mType) << std::endl;
|
||||
|
@ -1764,10 +1764,11 @@ namespace CSMWorld
|
||||
return content.mWander.mDistance;
|
||||
else
|
||||
return QVariant();
|
||||
case 2: // wander dur
|
||||
if (content.mType == ESM::AI_Wander ||
|
||||
content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
|
||||
case 2: // wander/follow dur
|
||||
if (content.mType == ESM::AI_Wander)
|
||||
return content.mWander.mDuration;
|
||||
else if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
|
||||
return content.mTarget.mDuration;
|
||||
else
|
||||
return QVariant();
|
||||
case 3: // wander ToD
|
||||
@ -1874,9 +1875,10 @@ namespace CSMWorld
|
||||
|
||||
break; // always save
|
||||
case 2:
|
||||
if (content.mType == ESM::AI_Wander ||
|
||||
content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
|
||||
if (content.mType == ESM::AI_Wander)
|
||||
content.mWander.mDuration = static_cast<short>(value.toInt());
|
||||
else if (content.mType == ESM::AI_Follow || content.mType == ESM::AI_Escort)
|
||||
content.mTarget.mDuration = static_cast<short>(value.toInt());
|
||||
else
|
||||
return; // return without saving
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user