[Solved] Pickpocketing code source

Everything about development and the OpenMW source code.
Post Reply
guigui
Posts: 33
Joined: 12 Apr 2020, 12:22

[Solved] Pickpocketing code source

Post by guigui »

Hi,

Can you confirm me that, if i modify (in red below) the .../mwmechanics/pickpocket.cpp source file like this:
[...]
bool Pickpocket::pick(const MWWorld::Ptr& item, int count)
{
float stackValue = static_cast<float>(item.getClass().getWeight(item) *100 * count);
float fPickPocketMod = MWBase::Environment::get()
.getWorld()
->getStore()
.get<ESM::GameSetting>()
.find("fPickPocketMod")
->mValue.getFloat();
float valueTerm = 10 * fPickPocketMod * stackValue;

return getDetected(valueTerm);
}
[...]

and recompile,
i will get a working OpenMW with pickpocketing mechanism based on item weight instead of item value ?
Last edited by guigui on 04 Mar 2023, 18:33, edited 1 time in total.
guigui
Posts: 33
Joined: 12 Apr 2020, 12:22

Re: Pickpocketing code source

Post by guigui »

I have the answer to my question:

Yes, just edit this .../mwmechanics/pickpocket.cpp line:
float stackValue = static_cast<float>(item.getClass().getValue(item) * count);
to
float stackValue = static_cast<float>(item.getClass().getWeight(item) * 100 * count);

then build and install the OpenMW package.

Example for Arch Linux:
1) cd /your_user_folder/the_path_you_choose_to_put_the_softwares_source_files/
2) git clone https://aur.archlinux.org/openmw-git.git
3) cd openmw-git
4) makepkg -o
5) [do your editing...]
6) makepkg -sefi
Post Reply