Condition factor added with use_condition param in LTX doesn't save properly
Created by: yohjimane
Describe the bug There is some code in engine which does work initially, but doesn't save properly to packets:
// Added by Axel, to enable optional condition use on any item
m_flags.set(FUsingCondition, READ_IF_EXISTS(pSettings, r_bool, section, "use_condition", false));
To Reproduce Steps to reproduce the behavior:
- Add some log like so in CInventoryItem::Load/Save funcs:
Msg("debug - save item %s with condition %f", m_object->cNameSect().c_str(), m_fCondition)
- load into game
- drop a weapon/item, shoot it
- pick it up, save game
- check logs from step 1 - correct values saved
- load game
- check logs from step 1 - correct values saved
- save game
- check logs from step 1 - observe bug, loaded values are reset to 1.f (unless the item condition has changed between steps 5 and 7; then it will be equal to
1 - conditionDecremented
)
Expected behavior use_condition param should save to packets
Desktop (please complete the following information):
- OS: Windows 10
- OpenXRay build version: 98f80503