Skip to content

Commit

Permalink
Merge pull request #259 from Allofich/DataFix
Browse files Browse the repository at this point in the history
Data offset corrections
  • Loading branch information
afritz1 authored Apr 23, 2024
2 parents 1890387 + d32eaaa commit 0c5560e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
14 changes: 7 additions & 7 deletions OpenTESArena/src/Assets/ExeData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ bool ExeData::Equipment::init(const char *data, const KeyValueFile &keyValueFile
initStringArray(this->armorEnchantmentNames, data + armorEnchantmentNamesOffset);
initInt8Array(this->armorEnchantmentQualities, data + armorEnchantmentQualitiesOffset);
initInt8Array(this->armorEnchantmentSpells, data + armorEnchantmentSpellsOffset);
initInt8Array(this->armorEnchantmentBonusPrices, data + armorEnchantmentBonusPricesOffset);
initInt16Array(this->armorEnchantmentBonusPrices, data + armorEnchantmentBonusPricesOffset);
initStringArray(this->weaponNames, data + weaponNamesOffset);
initInt8Array(this->weaponQualities, data + weaponQualitiesOffset);
initInt8Array(this->weaponBasePrices, data + weaponBasePricesOffset);
Expand All @@ -516,26 +516,26 @@ bool ExeData::Equipment::init(const char *data, const KeyValueFile &keyValueFile
initStringArray(this->weaponEnchantmentNames, data + weaponEnchantmentNamesOffset);
initInt8Array(this->weaponEnchantmentQualities, data + weaponEnchantmentQualitiesOffset);
initInt8Array(this->weaponEnchantmentSpells, data + weaponEnchantmentSpellsOffset);
initInt8Array(this->weaponEnchantmentBonusPrices, data + weaponEnchantmentBonusPricesOffset);
initInt16Array(this->weaponEnchantmentBonusPrices, data + weaponEnchantmentBonusPricesOffset);
initStringArray(this->spellcastingItemNames, data + spellcastingItemNamesOffset);
initInt8Array(this->spellcastingItemCumulativeChances, data + spellcastingItemCumulativeChancesOffset);
initInt8Array(this->spellcastingItemBasePrices, data + spellcastingItemBasePricesOffset);
initInt16Array(this->spellcastingItemBasePrices, data + spellcastingItemBasePricesOffset);
initInt8PairArray(this->spellcastingItemChargeRanges, data + spellcastingItemChargeRangesOffset);
initStringArray(this->spellcastingItemAttackSpellNames, data + spellcastingItemAttackSpellNamesOffset);
initInt8Array(this->spellcastingItemAttackSpellQualities, data + spellcastingItemAttackSpellQualitiesOffset);
initInt8Array(this->spellcastingItemAttackSpellSpells, data + spellcastingItemAttackSpellSpellsOffset);
initInt8Array(this->spellcastingItemAttackSpellPricesPerCharge, data + spellcastingItemAttackSpellPricesPerChargeOffset);
initInt16Array(this->spellcastingItemAttackSpellPricesPerCharge, data + spellcastingItemAttackSpellPricesPerChargeOffset);
initStringArray(this->spellcastingItemDefensiveSpellNames, data + spellcastingItemDefensiveSpellNamesOffset);
initInt8Array(this->spellcastingItemDefensiveSpellQualities, data + spellcastingItemDefensiveSpellQualitiesOffset);
initInt8Array(this->spellcastingItemDefensiveSpellSpells, data + spellcastingItemDefensiveSpellSpellsOffset);
initInt8Array(this->spellcastingItemDefensiveSpellPricesPerCharge, data + spellcastingItemDefensiveSpellPricesPerChargeOffset);
initInt16Array(this->spellcastingItemDefensiveSpellPricesPerCharge, data + spellcastingItemDefensiveSpellPricesPerChargeOffset);
initStringArray(this->spellcastingItemMiscSpellNames, data + spellcastingItemMiscSpellNamesOffset);
initInt8Array(this->spellcastingItemMiscSpellQualities, data + spellcastingItemMiscSpellQualitiesOffset);
initInt8Array(this->spellcastingItemMiscSpellSpells, data + spellcastingItemMiscSpellSpellsOffset);
initInt8Array(this->spellcastingItemMiscSpellPricesPerCharge, data + spellcastingItemMiscSpellPricesPerChargeOffset);
initInt16Array(this->spellcastingItemMiscSpellPricesPerCharge, data + spellcastingItemMiscSpellPricesPerChargeOffset);
initStringArray(this->enhancementItemNames, data + enhancementItemNamesOffset);
initInt8Array(this->enhancementItemCumulativeChances, data + enhancementItemCumulativeChancesOffset);
initInt8Array(this->enhancementItemBasePrices, data + enhancementItemBasePricesOffset);
initInt16Array(this->enhancementItemBasePrices, data + enhancementItemBasePricesOffset);
initStringArray(this->bodyPartNames, data + bodyPartNamesOffset);
initStringArray(this->weaponAnimationFilenames, data + weaponAnimFilenamesOffset);

Expand Down
20 changes: 10 additions & 10 deletions OpenTESArena/src/Assets/ExeData.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class ExeData
std::array<std::string, 14> armorEnchantmentNames;
std::array<uint8_t, 14> armorEnchantmentQualities;
std::array<uint8_t, 14> armorEnchantmentSpells; // 255 means attribute bonus instead of spell.
std::array<uint8_t, 14> armorEnchantmentBonusPrices;
std::array<uint16_t, 14> armorEnchantmentBonusPrices;

// Weapon values.
std::array<std::string, 18> weaponNames; // Staff, ..., long bow.
Expand All @@ -251,29 +251,29 @@ class ExeData
std::array<std::string, 14> weaponEnchantmentNames;
std::array<uint8_t, 14> weaponEnchantmentQualities;
std::array<uint8_t, 14> weaponEnchantmentSpells; // See armor enchantment note.
std::array<uint8_t, 14> weaponEnchantmentBonusPrices;
std::array<uint16_t, 14> weaponEnchantmentBonusPrices;

// Three categories of trinkets: spellcasting items, attribute enhancement items,
// and armor class items. Spellcasting items are split into offense/defense/misc.
std::array<std::string, 4> spellcastingItemNames;
std::array<uint8_t, 4> spellcastingItemCumulativeChances;
std::array<uint8_t, 4> spellcastingItemBasePrices;
std::array<uint16_t, 4> spellcastingItemBasePrices;
std::array<std::pair<uint8_t, uint8_t>, 4> spellcastingItemChargeRanges; // Min/max + 1...
std::array<std::string, 15> spellcastingItemAttackSpellNames;
std::array<uint8_t, 15> spellcastingItemAttackSpellQualities;
std::array<uint8_t, 15> spellcastingItemAttackSpellSpells;
std::array<uint8_t, 15> spellcastingItemAttackSpellPricesPerCharge;
std::array<uint16_t, 15> spellcastingItemAttackSpellPricesPerCharge;
std::array<std::string, 9> spellcastingItemDefensiveSpellNames;
std::array<uint8_t, 9> spellcastingItemDefensiveSpellQualities;
std::array<uint8_t, 9> spellcastingItemDefensiveSpellSpells;
std::array<uint8_t, 9> spellcastingItemDefensiveSpellPricesPerCharge;
std::array<uint16_t, 9> spellcastingItemDefensiveSpellPricesPerCharge;
std::array<std::string, 8> spellcastingItemMiscSpellNames;
std::array<uint8_t, 9> spellcastingItemMiscSpellQualities;
std::array<uint8_t, 9> spellcastingItemMiscSpellSpells;
std::array<uint8_t, 9> spellcastingItemMiscSpellPricesPerCharge;
std::array<uint8_t, 8> spellcastingItemMiscSpellQualities;
std::array<uint8_t, 8> spellcastingItemMiscSpellSpells;
std::array<uint16_t, 8> spellcastingItemMiscSpellPricesPerCharge;
std::array<std::string, 4> enhancementItemNames;
std::array<uint8_t, 4> enhancementItemCumulativeChances;
std::array<uint8_t, 4> enhancementItemBasePrices;
std::array<uint16_t, 4> enhancementItemBasePrices;

// @todo: artifacts.

Expand All @@ -286,7 +286,7 @@ class ExeData
struct Light
{
std::array<uint8_t, 48> windowTwilightColors; // VGA (6-bit, 63 = 255) RGB triplets for window color transition.
std::array<uint16_t, 14> waterTwilightLightLevels;
std::array<uint16_t, 16> waterTwilightLightLevels;

bool init(const char *data, const KeyValueFile &keyValueFile);
};
Expand Down
6 changes: 3 additions & 3 deletions data/text/aExeStrings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ SpellcastingItemChargeRanges=0x3D4F7
SpellcastingItemAttackSpellNames=0x3D4FF
SpellcastingItemAttackSpellQualities=0x3D5D9
SpellcastingItemAttackSpellSpells=0x3D5CA
SpellcastingItemAttackSpellPricesPerCharge=0x3D5E2
SpellcastingItemAttackSpellPricesPerCharge=0x3D5E8
SpellcastingItemDefensiveSpellNames=0x3D606
SpellcastingItemDefensiveSpellQualities=0x3D680
SpellcastingItemDefensiveSpellSpells=0x3D677
SpellcastingItemDefensiveSpellPricesPerCharge=0x3D689
SpellcastingItemMiscSpellNames=0x3D69B
SpellcastingItemMiscSpellQualities=0x3D70C
SpellcastingItemMiscSpellSpells=0x3D704
SpellcastingItemMiscSpellPricesPerCharge=0x3D71C
SpellcastingItemMiscSpellPricesPerCharge=0x3D714
EnhancementItemNames=0x3D724
EnhancementItemCumulativeChances=0x3D73E
EnhancementItemBasePrices=0x3D746
Expand All @@ -150,7 +150,7 @@ WeaponAnimationFilenames=0x41DAC

[Light]
WindowTwilightColors=0x3F42A
WaterTwilightLightLevels=0x3F40B
WaterTwilightLightLevels=0x3F40A

[Locations]
ProvinceNames=0x392F8
Expand Down
6 changes: 3 additions & 3 deletions data/text/acdExeStrings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ SpellcastingItemChargeRanges=0x3D7FB
SpellcastingItemAttackSpellNames=0x3D803
SpellcastingItemAttackSpellQualities=0x3D8DD
SpellcastingItemAttackSpellSpells=0x3D8CE
SpellcastingItemAttackSpellPricesPerCharge=0x3D8E6
SpellcastingItemAttackSpellPricesPerCharge=0x3D8EC
SpellcastingItemDefensiveSpellNames=0x3D90A
SpellcastingItemDefensiveSpellQualities=0x3D984
SpellcastingItemDefensiveSpellSpells=0x3D97B
SpellcastingItemDefensiveSpellPricesPerCharge=0x3D98D
SpellcastingItemMiscSpellNames=0x3D99F
SpellcastingItemMiscSpellQualities=0x3DA10
SpellcastingItemMiscSpellSpells=0x3DA08
SpellcastingItemMiscSpellPricesPerCharge=0x3DA20
SpellcastingItemMiscSpellPricesPerCharge=0x3DA18
EnhancementItemNames=0x3DA28
EnhancementItemCumulativeChances=0x3DA42
EnhancementItemBasePrices=0x3DA4A
Expand All @@ -150,7 +150,7 @@ WeaponAnimationFilenames=0x4214E

[Light]
WindowTwilightColors=0x3F766
WaterTwilightLightLevels=0x3F747
WaterTwilightLightLevels=0x3F746

[Locations]
ProvinceNames=0x394F8
Expand Down

0 comments on commit 0c5560e

Please sign in to comment.