mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 15:15:31 +00:00
Add default values for fDifficultyMult and sDifficulty (Fixes #1742)
Also added values for some other GMSTs added in a Morrowind patch or Tribunal/BM
This commit is contained in:
parent
09f27d142a
commit
28e61c9834
3 changed files with 79 additions and 28 deletions
|
@ -350,36 +350,59 @@ namespace MWWorld
|
||||||
|
|
||||||
void World::ensureNeededRecords()
|
void World::ensureNeededRecords()
|
||||||
{
|
{
|
||||||
if (!mStore.get<ESM::GameSetting>().search("sCompanionShare"))
|
std::map<std::string, ESM::Variant> gmst;
|
||||||
|
// Companion (tribunal)
|
||||||
|
gmst["sCompanionShare"] = ESM::Variant("Companion Share");
|
||||||
|
gmst["sCompanionWarningMessage"] = ESM::Variant("Warning message");
|
||||||
|
gmst["sCompanionWarningButtonOne"] = ESM::Variant("Button 1");
|
||||||
|
gmst["sCompanionWarningButtonTwo"] = ESM::Variant("Button 2");
|
||||||
|
gmst["sCompanionShare"] = ESM::Variant("Companion Share");
|
||||||
|
gmst["sProfitValue"] = ESM::Variant("Profit Value");
|
||||||
|
gmst["sTeleportDisabled"] = ESM::Variant("Teleport disabled");
|
||||||
|
gmst["sLevitateDisabled"] = ESM::Variant("Levitate disabled");
|
||||||
|
|
||||||
|
// Missing in unpatched MW 1.0
|
||||||
|
gmst["sDifficulty"] = ESM::Variant("Difficulty");
|
||||||
|
gmst["fDifficultyMult"] = ESM::Variant(5.f);
|
||||||
|
gmst["sAuto_Run"] = ESM::Variant("Auto Run");
|
||||||
|
gmst["sServiceRefusal"] = ESM::Variant("Service Refusal");
|
||||||
|
gmst["sNeedOneSkill"] = ESM::Variant("Need one skill");
|
||||||
|
gmst["sNeedTwoSkills"] = ESM::Variant("Need two skills");
|
||||||
|
gmst["sEasy"] = ESM::Variant("Easy");
|
||||||
|
gmst["sHard"] = ESM::Variant("Hard");
|
||||||
|
gmst["sDeleteNote"] = ESM::Variant("Delete Note");
|
||||||
|
gmst["sEditNote"] = ESM::Variant("Edit Note");
|
||||||
|
|
||||||
|
// Werewolf (BM)
|
||||||
|
gmst["fWereWolfRunMult"] = ESM::Variant(1.f);
|
||||||
|
gmst["fWereWolfSilverWeaponDamageMult"] = ESM::Variant(1.f);
|
||||||
|
|
||||||
|
|
||||||
|
std::map<std::string, ESM::Variant> globals;
|
||||||
|
// vanilla Morrowind does not define dayspassed.
|
||||||
|
globals["dayspassed"] = ESM::Variant(1); // but the addons start counting at 1 :(
|
||||||
|
globals["WerewolfClawMult"] = ESM::Variant(1.f);
|
||||||
|
|
||||||
|
for (std::map<std::string, ESM::Variant>::iterator it = gmst.begin(); it != gmst.end(); ++it)
|
||||||
{
|
{
|
||||||
ESM::GameSetting sCompanionShare;
|
if (!mStore.get<ESM::GameSetting>().search(it->first))
|
||||||
sCompanionShare.mId = "sCompanionShare";
|
{
|
||||||
ESM::Variant value;
|
ESM::GameSetting setting;
|
||||||
value.setType(ESM::VT_String);
|
setting.mId = it->first;
|
||||||
value.setString("Companion Share");
|
setting.mValue = it->second;
|
||||||
sCompanionShare.mValue = value;
|
mStore.insertStatic(setting);
|
||||||
mStore.insertStatic(sCompanionShare);
|
}
|
||||||
}
|
}
|
||||||
if (!mStore.get<ESM::Global>().search("dayspassed"))
|
|
||||||
|
for (std::map<std::string, ESM::Variant>::iterator it = globals.begin(); it != globals.end(); ++it)
|
||||||
{
|
{
|
||||||
// vanilla Morrowind does not define dayspassed.
|
if (!mStore.get<ESM::Global>().search(it->first))
|
||||||
ESM::Global dayspassed;
|
{
|
||||||
dayspassed.mId = "dayspassed";
|
ESM::Global setting;
|
||||||
ESM::Variant value;
|
setting.mId = it->first;
|
||||||
value.setType(ESM::VT_Long);
|
setting.mValue = it->second;
|
||||||
value.setInteger(1); // but the addons start counting at 1 :(
|
mStore.insertStatic(setting);
|
||||||
dayspassed.mValue = value;
|
}
|
||||||
mStore.insertStatic(dayspassed);
|
|
||||||
}
|
|
||||||
if (!mStore.get<ESM::GameSetting>().search("fWereWolfRunMult"))
|
|
||||||
{
|
|
||||||
ESM::GameSetting fWereWolfRunMult;
|
|
||||||
fWereWolfRunMult.mId = "fWereWolfRunMult";
|
|
||||||
ESM::Variant value;
|
|
||||||
value.setType(ESM::VT_Float);
|
|
||||||
value.setFloat(1.f);
|
|
||||||
fWereWolfRunMult.mValue = value;
|
|
||||||
mStore.insertStatic(fWereWolfRunMult);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,30 @@ namespace
|
||||||
|
|
||||||
ESM::Variant::Variant() : mType (VT_None), mData (0) {}
|
ESM::Variant::Variant() : mType (VT_None), mData (0) {}
|
||||||
|
|
||||||
|
ESM::Variant::Variant(const std::string &value)
|
||||||
|
{
|
||||||
|
mData = 0;
|
||||||
|
mType = VT_None;
|
||||||
|
setType(VT_String);
|
||||||
|
setString(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
ESM::Variant::Variant(int value)
|
||||||
|
{
|
||||||
|
mData = 0;
|
||||||
|
mType = VT_None;
|
||||||
|
setType(VT_Long);
|
||||||
|
setInteger(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
ESM::Variant::Variant(float value)
|
||||||
|
{
|
||||||
|
mData = 0;
|
||||||
|
mType = VT_None;
|
||||||
|
setType(VT_Float);
|
||||||
|
setFloat(value);
|
||||||
|
}
|
||||||
|
|
||||||
ESM::Variant::~Variant()
|
ESM::Variant::~Variant()
|
||||||
{
|
{
|
||||||
delete mData;
|
delete mData;
|
||||||
|
|
|
@ -38,6 +38,10 @@ namespace ESM
|
||||||
|
|
||||||
Variant();
|
Variant();
|
||||||
|
|
||||||
|
Variant (const std::string& value);
|
||||||
|
Variant (int value);
|
||||||
|
Variant (float value);
|
||||||
|
|
||||||
~Variant();
|
~Variant();
|
||||||
|
|
||||||
Variant& operator= (const Variant& variant);
|
Variant& operator= (const Variant& variant);
|
||||||
|
@ -83,4 +87,4 @@ namespace ESM
|
||||||
bool operator!= (const Variant& left, const Variant& right);
|
bool operator!= (const Variant& left, const Variant& right);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue