Commit Graph

962 Commits (a9877aea984243bc04cf26b80320a7d96c22124f)

Author SHA1 Message Date
Evil Eye 5f406158b5 Zero initialize context index 3 years ago
Alexei Dobrohotov 7a0c13fcf8 Make better use of std::clamp 3 years ago
Bo Svensson 6cf74f7041
refactors ESM::Land (#3213)
With this PR we reduce coupling, simplify code, encapsulate a variable and separate actual `ESM` data from its context.
3 years ago
Bo Svensson 4657c655b1 refactors parentFileIndices (#3211)
This PR aims to start addressing `ESM` design issues that have silenced errors we incorporated into groundcover `ESM` loading approaches.

- We move the resolution of `parentFileIndices` from `ESMStore` to `ESMReader` as suggested in a `TODO` comment.
- We improve a highly misleading comment which downplayed the significance of `parentFileIndices`.
- We document important preconditions.
- We move a user facing error message to the highest level and improve its context.
- We remove an inappropriate `setGlobalReaderList` method. We now pass this reader list into the method that requires it.
- We remove a thoroughly pointless optimisation of `Store<ESM::LandTexture>`'s construction that has unnecessarily depended on `getGlobalReaderList`.

There should be no functional changes for `master`, but this PR should remove an issue blocking PR #3208.
3 years ago
psi29a 4c81518abb Merge branch 'puddle' into 'master'
Give each reflect and spell absorption effect a chance to apply

Closes #6255 and #6253

See merge request OpenMW/openmw!1279
3 years ago
Petr Mikheev 47c89567fb Load LuaScriptsCfg from both *.omwscripts and *.omwaddon files. 3 years ago
Petr Mikheev 6aab246879 Add ESM records that are needed to store Lua scripts configuration;
Use ptr.getType() (i.e. esm record names) instead of typeid(ptr.getClass()) in apps/openmw/mwlua.
3 years ago
Evil Eye 4ec927829f Give each reflect and spell absorption effect a chance to apply 3 years ago
Andrei Kortunov 0f3c0cb0a0 Fix argument types mismatch 3 years ago
elsid 18d3102148
Do not use union to access FIXED_STRING<4> as int
https://en.cppreference.com/w/cpp/language/union:
> It's undefined behavior to read from the member of the union that wasn't most recently written.
3 years ago
Petr Mikheev a8acc19988 Avoid copying std::string in MWWorld::Ptr::getTypeDescription() 3 years ago
Evil Eye dc1fe62dde Overhaul magic effects to work with onApply and onEnd events 3 years ago
cc9cii 7227a83e60 Preserve "blocked" record flags when saving with OpenCS. This will help outputs of OpenCS to be used with vanilla Morrowind.
Sample use case: users are using the Morrowind Code Patch feature that allows modders to enable this flag to differentiate editor-made potions from player crafted potions for tooltips.
3 years ago
Bret Curtis c99bddc8dc Revert "Move reference to the right cell according to its geographical position"
This reverts commit d0677c3f07.
3 years ago
psi29a 9b7e14ec00 Merge branch 'OpenCS-moved-reference' into 'master'
OpenCS - Fix moved reference - Issues #3514 and #4752

See merge request OpenMW/openmw!1051

(cherry picked from commit 2bee171c7990522da33c2667f7d079fa35f4ede0)

36c30f7f Fix for Issue #3514 where moving a reference to another cell is not handled properly.
40327681 Update the changelog.
3 years ago
Cédric Mocquillon d0677c3f07 Move reference to the right cell according to its geographical position 3 years ago
Evil Eye 5f84494046 Fail on invalid water levels 3 years ago
jvoisin 7b32458aec Improve a bit two esmreader logging call 3 years ago
elsid aec4e02417
Ignore only CellRefs with preceding MVRF subrecord
MVRF subrecord means that only single following FRMR subrecord is moved not the
rest of subrecords.
4 years ago
elsid cfdbd0d471
Indicate moved cell refs explicitly
This is less error prone approach than use of MovedCellRef fields.

Also make separate functions for skipping and reading moved cell refs to avoid
passing special flags  logic and null pointers for unused arguments.
4 years ago
jvoisin 5aaac8e47e Reduce a bit the size of getHT
Factoring common code parts outside of a template
is apparently a good practise to reduce code duplication
(and the size of openmw by around 0.5%),
and should improve a bit the performances,
since the whole `std::to_string` * 2 + string concatenation
dance results in quite a lot of code, preventing inlining on my machine.
4 years ago
Petr Mikheev 702eb19271 Fixes and refactoring 4 years ago
Petr Mikheev 8c6d303730 Saving/loading for Lua scripts (saves format is changed) 4 years ago
Petr Mikheev 6db2450c90 Initial support of generated RefNums with negative mContentFile. 4 years ago
Petr Mikheev 479856f812 Add components/lua/scriptscontainer and components/esm/luascripts 4 years ago
psi29a c372c239a6 Merge branch 'master' into 'OpenCS_Bug6017'
# Conflicts:
#   CHANGELOG.md
4 years ago
cc9cii a47ebf5c9e For consistency with TES CS, force DELE record writes to be 4 bytes (currently writes 1 byte). 4 years ago
cc9cii fea1ac2c0f Remove dead code from commit 024ad3276b. 4 years ago
cc9cii f68c81e631 Merge branch 'master' into 'OpenCS_Bug6017' 4 years ago
cc9cii 4b3de46bfa Use enums in place of magic numbers. Ensure Creature and NPC cell references are always saved as persistent. 4 years ago
elsid 91cece5cc4
Define ESM::Land static constants as constexpr
To avoid linking issues.
4 years ago
cc9cii f2a301653c Remove redundant mPersistent member from ESM::NPC and ESM::Creature, replaced by mRecordFlags. Fixed the editing of the persistence flag value. 4 years ago
jvoisin 8561245fda Minor refactor making use of std::clamp 4 years ago
cc9cii 2a76634f5f Moved persistence flag from references to the header flags of referenceables (e.g. Static, Weapon, etc). Editing widget is not fully working. 4 years ago
cc9cii 024ad3276b Partial fix for #6017. The persistence flag of the references are saved but it is not yet possible to modify it via OpenCS. 4 years ago
jvoisin 2c8f328ac2 Use make_unique instead of unique_ptr+new 4 years ago
Evil Eye 080106e802 Merge branch 'inline' into 'master'
Inline a couple of methods in esmreader.cpp

See merge request OpenMW/openmw!945
4 years ago
Evil Eye 0998929608 Merge branch 'noreturn' into 'master'
Sprinkle some [[noreturn]] where possible

See merge request OpenMW/openmw!793
4 years ago
Evil Eye 1a421c3b2e Merge branch 'multicast' into 'master'
Fix two excessive type casting instances

See merge request OpenMW/openmw!953
4 years ago
Evil Eye 7e9785941c Merge branch 'default' into 'master'
Use `default` instead of empty constructors/destructors

See merge request OpenMW/openmw!957
4 years ago
jvoisin 5840279f16 Use `default` instead of empty constructors/destructors
See https://pvs-studio.com/en/docs/warnings/v832/ for details
4 years ago
jvoisin b2c170efa0 Use initialization lists where possible 4 years ago
jvoisin 33e035cc95 Fix two excessive type casting instances
No need to to a string -> char* -> string dance.
4 years ago
jvoisin aec3c74fa5 Sprinkle some [[noreturn]] where possible 4 years ago
jvoisin 17e0c75d30 Some more constexpr in esm/variant.cpp 4 years ago
jvoisin 6140c9c3fd Don't catch exceptions in EsmReader::getExact 4 years ago
jvoisin cff11fbca9 Inline a couple of methods in esmreader.cpp 4 years ago
psi29a afda721d4b Merge branch 'race_floats' into 'master'
Display Race record height/weight as a float

See merge request OpenMW/openmw!880
4 years ago
psi29a a6b695e15b Merge branch 'esmcleanup' into 'master'
More ESM cleanup

See merge request OpenMW/openmw!903
4 years ago
jvoisin 22153cca7b Reduce a bit the code bloat in hot paths/small functions
There is no need to bloat hot/small functions with
a ton of function calls and involving locales
for simple error messages.
4 years ago