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