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

Remove AI flag from the UI and instead auto-detect whether to save AIDT records. Should resolve bug #2879.

This commit is contained in:
cc9cii 2015-09-12 10:15:32 +10:00
parent 5a5e1a3b22
commit 45aee1b508
6 changed files with 14 additions and 13 deletions

View file

@ -71,7 +71,6 @@ namespace CSMWorld
{ ColumnId_Weight, "Weight" }, { ColumnId_Weight, "Weight" },
{ ColumnId_EnchantmentPoints, "Enchantment Points" }, { ColumnId_EnchantmentPoints, "Enchantment Points" },
{ ColumnId_Quality, "Quality" }, { ColumnId_Quality, "Quality" },
{ ColumnId_Ai, "AI" },
{ ColumnId_AiHello, "AI Hello" }, { ColumnId_AiHello, "AI Hello" },
{ ColumnId_AiFlee, "AI Flee" }, { ColumnId_AiFlee, "AI Flee" },
{ ColumnId_AiFight, "AI Fight" }, { ColumnId_AiFight, "AI Fight" },

View file

@ -65,7 +65,7 @@ namespace CSMWorld
ColumnId_Weight = 50, ColumnId_Weight = 50,
ColumnId_EnchantmentPoints = 51, ColumnId_EnchantmentPoints = 51,
ColumnId_Quality = 52, ColumnId_Quality = 52,
ColumnId_Ai = 53, // unused
ColumnId_AiHello = 54, ColumnId_AiHello = 54,
ColumnId_AiFlee = 55, ColumnId_AiFlee = 55,
ColumnId_AiFight = 56, ColumnId_AiFight = 56,

View file

@ -479,7 +479,6 @@ namespace CSMWorld
struct ActorColumns : public NameColumns struct ActorColumns : public NameColumns
{ {
const RefIdColumn *mHasAi;
const RefIdColumn *mHello; const RefIdColumn *mHello;
const RefIdColumn *mFlee; const RefIdColumn *mFlee;
const RefIdColumn *mFight; const RefIdColumn *mFight;
@ -524,9 +523,6 @@ namespace CSMWorld
const Record<RecordT>& record = static_cast<const Record<RecordT>&> ( const Record<RecordT>& record = static_cast<const Record<RecordT>&> (
data.getRecord (RefIdData::LocalIndex (index, BaseRefIdAdapter<RecordT>::getType()))); data.getRecord (RefIdData::LocalIndex (index, BaseRefIdAdapter<RecordT>::getType())));
if (column==mActors.mHasAi)
return record.get().mHasAI!=0;
if (column==mActors.mHello) if (column==mActors.mHello)
return record.get().mAiData.mHello; return record.get().mAiData.mHello;
@ -568,9 +564,7 @@ namespace CSMWorld
data.getRecord (RefIdData::LocalIndex (index, BaseRefIdAdapter<RecordT>::getType()))); data.getRecord (RefIdData::LocalIndex (index, BaseRefIdAdapter<RecordT>::getType())));
RecordT record2 = record.get(); RecordT record2 = record.get();
if (column==mActors.mHasAi) if (column==mActors.mHello)
record2.mHasAI = value.toInt();
else if (column==mActors.mHello)
record2.mAiData.mHello = value.toInt(); record2.mAiData.mHello = value.toInt();
else if (column==mActors.mFlee) else if (column==mActors.mFlee)
record2.mAiData.mFlee = value.toInt(); record2.mAiData.mFlee = value.toInt();

View file

@ -113,8 +113,6 @@ CSMWorld::RefIdCollection::RefIdCollection()
ActorColumns actorsColumns (nameColumns); ActorColumns actorsColumns (nameColumns);
mColumns.push_back (RefIdColumn (Columns::ColumnId_Ai, ColumnBase::Display_Boolean));
actorsColumns.mHasAi = &mColumns.back();
mColumns.push_back (RefIdColumn (Columns::ColumnId_AiHello, ColumnBase::Display_Integer)); mColumns.push_back (RefIdColumn (Columns::ColumnId_AiHello, ColumnBase::Display_Integer));
actorsColumns.mHello = &mColumns.back(); actorsColumns.mHello = &mColumns.back();
mColumns.push_back (RefIdColumn (Columns::ColumnId_AiFlee, ColumnBase::Display_Integer)); mColumns.push_back (RefIdColumn (Columns::ColumnId_AiFlee, ColumnBase::Display_Integer));

View file

@ -96,7 +96,12 @@ namespace ESM {
mInventory.save(esm); mInventory.save(esm);
mSpells.save(esm); mSpells.save(esm);
if (mHasAI) { if (mAiData.mHello != 0
|| mAiData.mFight != 0
|| mAiData.mFlee != 0
|| mAiData.mAlarm != 0
|| mAiData.mServices != 0)
{
esm.writeHNT("AIDT", mAiData, sizeof(mAiData)); esm.writeHNT("AIDT", mAiData, sizeof(mAiData));
} }
mTransport.save(esm); mTransport.save(esm);

View file

@ -121,7 +121,12 @@ namespace ESM
mInventory.save(esm); mInventory.save(esm);
mSpells.save(esm); mSpells.save(esm);
if (mHasAI) { if (mAiData.mHello != 0
|| mAiData.mFight != 0
|| mAiData.mFlee != 0
|| mAiData.mAlarm != 0
|| mAiData.mServices != 0)
{
esm.writeHNT("AIDT", mAiData, sizeof(mAiData)); esm.writeHNT("AIDT", mAiData, sizeof(mAiData));
} }