Remove FactionID editing from OpenCS (#2636)

* Remove FactionID editing

* remove useless comments

* rename FactionID to Unknown
pull/2638/head
Assumeru 5 years ago committed by Alexei Dobrohotov
parent dfbe0021a5
commit 737aa1e4e8

@ -1032,14 +1032,6 @@ void Record<ESM::NPC>::print()
std::cout << " Reputation: " << (int)mData.mNpdt.mReputation << std::endl;
std::cout << " Disposition: " << (int)mData.mNpdt.mDisposition << std::endl;
std::cout << " Rank: " << (int)mData.mNpdt.mRank << std::endl;
//Why do we want to print these fields? They are padding in the struct and contain
// nothing of real value. Now we don't deal with NPDTstruct12 in runtime either...
//std::cout << " Unknown1: "
// << (unsigned int)((unsigned char)mData.mNpdt12.mUnknown1) << std::endl;
//std::cout << " Unknown2: "
// << (unsigned int)((unsigned char)mData.mNpdt12.mUnknown2) << std::endl;
//std::cout << " Unknown3: "
// << (unsigned int)((unsigned char)mData.mNpdt12.mUnknown3) << std::endl;
std::cout << " Gold: " << mData.mNpdt.mGold << std::endl;
}
else {
@ -1047,7 +1039,6 @@ void Record<ESM::NPC>::print()
std::cout << " Reputation: " << (int)mData.mNpdt.mReputation << std::endl;
std::cout << " Disposition: " << (int)mData.mNpdt.mDisposition << std::endl;
std::cout << " Rank: " << (int)mData.mNpdt.mRank << std::endl;
std::cout << " FactionID: " << (int)mData.mNpdt.mFactionID << std::endl;
std::cout << " Attributes:" << std::endl;
std::cout << " Strength: " << (int)mData.mNpdt.mStrength << std::endl;

@ -236,7 +236,6 @@ namespace CSMWorld
{ ColumnId_FactionReactions, "Reactions" },
{ ColumnId_FactionRanks, "Ranks" },
//{ ColumnId_FactionID, "Faction ID" },
{ ColumnId_FactionReaction, "Reaction" },
{ ColumnId_FactionAttrib1, "Attrib 1" },
@ -248,7 +247,6 @@ namespace CSMWorld
{ ColumnId_EffectList, "Effects" },
{ ColumnId_EffectId, "Effect" },
//{ ColumnId_EffectAttribute, "Attrib" },
{ ColumnId_EffectRange, "Range" },
{ ColumnId_EffectArea, "Area" },
@ -257,7 +255,6 @@ namespace CSMWorld
{ ColumnId_AiWanderDist, "Wander Dist" },
{ ColumnId_AiDuration, "Ai Duration" },
{ ColumnId_AiWanderToD, "Wander ToD" },
//{ ColumnId_AiWanderIdle, "Wander Idle" },
{ ColumnId_AiWanderRepeat, "Wander Repeat" },
{ ColumnId_AiActivateName, "Activate" },
{ ColumnId_AiTargetId, "Target ID" },
@ -291,7 +288,6 @@ namespace CSMWorld
{ ColumnId_UChar, "Value [0..255]" },
{ ColumnId_NpcMisc, "NPC Misc" },
{ ColumnId_Level, "Level" },
{ ColumnId_NpcFactionID, "Faction ID" },
{ ColumnId_GenderNpc, "Gender"},
{ ColumnId_Mana, "Mana" },
{ ColumnId_Fatigue, "Fatigue" },

@ -225,12 +225,10 @@ namespace CSMWorld
ColumnId_SoundChance = 210,
ColumnId_FactionReactions = 211,
//ColumnId_FactionID = 212,
ColumnId_FactionReaction = 213,
ColumnId_EffectList = 214,
ColumnId_EffectId = 215,
//ColumnId_EffectAttribute = 216,
ColumnId_EffectRange = 217,
ColumnId_EffectArea = 218,
@ -275,7 +273,6 @@ namespace CSMWorld
ColumnId_UChar = 250,
ColumnId_NpcMisc = 251,
ColumnId_Level = 252,
ColumnId_NpcFactionID = 253,
ColumnId_GenderNpc = 254,
ColumnId_Mana = 255,
ColumnId_Fatigue = 256,

@ -1096,27 +1096,25 @@ QVariant CSMWorld::NpcMiscRefIdAdapter::getNestedData (const RefIdColumn *column
case 1: return QVariant(QVariant::UserType);
case 2: return QVariant(QVariant::UserType);
case 3: return QVariant(QVariant::UserType);
case 4: return QVariant(QVariant::UserType);
case 5: return static_cast<int>(record.get().mNpdt.mDisposition);
case 6: return static_cast<int>(record.get().mNpdt.mReputation);
case 7: return static_cast<int>(record.get().mNpdt.mRank);
case 8: return record.get().mNpdt.mGold;
case 9: return record.get().mPersistent == true;
case 4: return static_cast<int>(record.get().mNpdt.mDisposition);
case 5: return static_cast<int>(record.get().mNpdt.mReputation);
case 6: return static_cast<int>(record.get().mNpdt.mRank);
case 7: return record.get().mNpdt.mGold;
case 8: return record.get().mPersistent == true;
default: return QVariant(); // throw an exception here?
}
else
switch (subColIndex)
{
case 0: return static_cast<int>(record.get().mNpdt.mLevel);
case 1: return static_cast<int>(record.get().mNpdt.mFactionID);
case 2: return static_cast<int>(record.get().mNpdt.mHealth);
case 3: return static_cast<int>(record.get().mNpdt.mMana);
case 4: return static_cast<int>(record.get().mNpdt.mFatigue);
case 5: return static_cast<int>(record.get().mNpdt.mDisposition);
case 6: return static_cast<int>(record.get().mNpdt.mReputation);
case 7: return static_cast<int>(record.get().mNpdt.mRank);
case 8: return record.get().mNpdt.mGold;
case 9: return record.get().mPersistent == true;
case 1: return static_cast<int>(record.get().mNpdt.mHealth);
case 2: return static_cast<int>(record.get().mNpdt.mMana);
case 3: return static_cast<int>(record.get().mNpdt.mFatigue);
case 4: return static_cast<int>(record.get().mNpdt.mDisposition);
case 5: return static_cast<int>(record.get().mNpdt.mReputation);
case 6: return static_cast<int>(record.get().mNpdt.mRank);
case 7: return record.get().mNpdt.mGold;
case 8: return record.get().mPersistent == true;
default: return QVariant(); // throw an exception here?
}
}
@ -1137,27 +1135,25 @@ void CSMWorld::NpcMiscRefIdAdapter::setNestedData (const RefIdColumn *column,
case 1: return;
case 2: return;
case 3: return;
case 4: return;
case 5: npc.mNpdt.mDisposition = static_cast<signed char>(value.toInt()); break;
case 6: npc.mNpdt.mReputation = static_cast<signed char>(value.toInt()); break;
case 7: npc.mNpdt.mRank = static_cast<signed char>(value.toInt()); break;
case 8: npc.mNpdt.mGold = value.toInt(); break;
case 9: npc.mPersistent = value.toBool(); break;
case 4: npc.mNpdt.mDisposition = static_cast<signed char>(value.toInt()); break;
case 5: npc.mNpdt.mReputation = static_cast<signed char>(value.toInt()); break;
case 6: npc.mNpdt.mRank = static_cast<signed char>(value.toInt()); break;
case 7: npc.mNpdt.mGold = value.toInt(); break;
case 8: npc.mPersistent = value.toBool(); break;
default: return; // throw an exception here?
}
else
switch(subColIndex)
{
case 0: npc.mNpdt.mLevel = static_cast<short>(value.toInt()); break;
case 1: npc.mNpdt.mFactionID = static_cast<char>(value.toInt()); break;
case 2: npc.mNpdt.mHealth = static_cast<unsigned short>(value.toInt()); break;
case 3: npc.mNpdt.mMana = static_cast<unsigned short>(value.toInt()); break;
case 4: npc.mNpdt.mFatigue = static_cast<unsigned short>(value.toInt()); break;
case 5: npc.mNpdt.mDisposition = static_cast<signed char>(value.toInt()); break;
case 6: npc.mNpdt.mReputation = static_cast<signed char>(value.toInt()); break;
case 7: npc.mNpdt.mRank = static_cast<signed char>(value.toInt()); break;
case 8: npc.mNpdt.mGold = value.toInt(); break;
case 9: npc.mPersistent = value.toBool(); break;
case 1: npc.mNpdt.mHealth = static_cast<unsigned short>(value.toInt()); break;
case 2: npc.mNpdt.mMana = static_cast<unsigned short>(value.toInt()); break;
case 3: npc.mNpdt.mFatigue = static_cast<unsigned short>(value.toInt()); break;
case 4: npc.mNpdt.mDisposition = static_cast<signed char>(value.toInt()); break;
case 5: npc.mNpdt.mReputation = static_cast<signed char>(value.toInt()); break;
case 6: npc.mNpdt.mRank = static_cast<signed char>(value.toInt()); break;
case 7: npc.mNpdt.mGold = value.toInt(); break;
case 8: npc.mPersistent = value.toBool(); break;
default: return; // throw an exception here?
}
@ -1166,7 +1162,7 @@ void CSMWorld::NpcMiscRefIdAdapter::setNestedData (const RefIdColumn *column,
int CSMWorld::NpcMiscRefIdAdapter::getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const
{
return 10; // Level, FactionID, Health, Mana, Fatigue, Disposition, Reputation, Rank, Gold, Persist
return 9; // Level, Health, Mana, Fatigue, Disposition, Reputation, Rank, Gold, Persist
}
int CSMWorld::NpcMiscRefIdAdapter::getNestedRowsCount(const RefIdColumn *column, const RefIdData& data, int index) const

@ -535,8 +535,6 @@ CSMWorld::RefIdCollection::RefIdCollection()
mNestedAdapters.push_back (std::make_pair(&mColumns.back(), miscMap));
mColumns.back().addColumn(
new RefIdColumn (Columns::ColumnId_Level, CSMWorld::ColumnBase::Display_SignedInteger16));
mColumns.back().addColumn(
new RefIdColumn (Columns::ColumnId_NpcFactionID, CSMWorld::ColumnBase::Display_SignedInteger8));
mColumns.back().addColumn(
new RefIdColumn (Columns::ColumnId_Health, CSMWorld::ColumnBase::Display_UnsignedInteger16));
mColumns.back().addColumn(

@ -216,9 +216,9 @@ namespace ESM
mNpdt.mReputation = 0;
mNpdt.mHealth = mNpdt.mMana = mNpdt.mFatigue = 0;
mNpdt.mDisposition = 0;
mNpdt.mFactionID = 0;
mNpdt.mUnknown1 = 0;
mNpdt.mRank = 0;
mNpdt.mUnknown = 0;
mNpdt.mUnknown2 = 0;
mNpdt.mGold = 0;
}

@ -87,10 +87,10 @@ struct NPC
// mSkill can grow up to 200, it must be unsigned
unsigned char mSkills[Skill::Length];
char mFactionID;
char mUnknown1;
unsigned short mHealth, mMana, mFatigue;
unsigned char mDisposition, mReputation, mRank;
char mUnknown;
char mUnknown2;
int mGold;
}; // 52 bytes

Loading…
Cancel
Save