Commit Graph

1160 Commits (master)

Author SHA1 Message Date
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
Dobrohotov Alexei e68a454fd8 More ESM cleanup 4 years ago
Benjamin Winger 21f04f0d0f
Fixed data subrecord name for Armour record used in error 4 years ago
Benjamin Winger 41cfcfdc0f
Display Race record height/weight as a float 4 years ago
Bret Curtis 66a527c3de
Merge pull request #3075 from akortunov/warnfix
Fix MSVC's C4244 and C4267 warnings
4 years ago
Petr Mikheev 4a7147e222 Merge branch 'constexpr_esm' into 'master'
Use a constexpr for esm cc

See merge request OpenMW/openmw!849
4 years ago
jvoisin bcd8190516 Fix a crash in aipackage.cpp 4 years ago
jvoisin 89f721fad3 Use a constexpr for esm cc 4 years ago
Andrei Kortunov 963e1b8b3f Fix MSVC's C4244 warnings 4 years ago
Andrei Kortunov f9d42ed396 Fix MSVC's C4267 warnings 4 years ago
elsid b806445a36
Use existing min implementation 4 years ago
psi29a 08e1a8e0fb Merge branch 'esm_opti' into 'master'
Teensy optimisation for esmtool

See merge request OpenMW/openmw!826
4 years ago
jvoisin 8a56ba6aaa Fix compilation 4 years ago
elsid fbeccc2908 Apply 1 suggestion(s) to 1 file(s) 4 years ago
jvoisin e97e4d07dd Teensy optimisation for esmtool
- Use an unordered_set instead of a list to
  keep track of skipped records.
- Reduce the number of conditions when parsing 4-letters
  records by using a switch-case instead of cascading conditions.
- Add a const
4 years ago
Dobrohotov Alexei 57c372a50e ESM code cleanup 4 years ago
psi29a e94181b2b2 Merge branch 'constexpr' into 'master'
Sprinkle a couple of constexpr found by VS

See merge request OpenMW/openmw!800

(cherry picked from commit 5e8ea624bc85acebf457592dd10b790124ecf6ef)

5704b2ac Sprinkle a couple of constexpr found by VS
4 years ago
jvoisin 5f65583a3a Fix a heap overflow in loadpgrd.cpp 4 years ago
Evil Eye abb120b439 Don't log a warning for reading to the end of the subrecord 4 years ago
Alexei Dobrohotov add04a4ea0 Merge branch 'fix_esm' into 'master'
Fix a read head-buffer-overflow in esm

See merge request OpenMW/openmw!751
4 years ago
jvoisin 032ba1e9a0 Fix the compilation 4 years ago
jvoisin c0f7e0d585 Use isnan 4 years ago
jvoisin 38316cdaf8 Fix various warnings found by clang
- unused alias
- inefficient use of push_back
- exceptions not inheriting from std::exception
- weird use of a comma
- value compared against itself
4 years ago
jvoisin a35eae3dd1 Fix a read head-buffer-overflow in esm
The check forgot to account for the terminal zero.
4 years ago
Evil Eye 80266d435c Merge branch 'fix_crash' into 'master'
Fix an off-by-one in loadscpt

See merge request OpenMW/openmw!728
4 years ago
Andrei Kortunov 016a1d45df Remove outdated field - remnant from earlier implementation 4 years ago
jvoisin 54adb9cbed Fix an off-by-one in loadscpt 4 years ago
psi29a 301411c5c5 Merge branch 'esm_variant' into 'master'
Use std::variant for ESM::Variant implementation

See merge request OpenMW/openmw!719
4 years ago
Andrei Kortunov 124a33d8a3 Fix uninitialized variables 4 years ago
elsid 8e1c92d9af
Use std::variant for ESM::Variant implementation 4 years ago
elsid 03fc3ec803
Do not allow write variant of string as local variable
To be consitent with read where it's not allowed.
4 years ago
Gleb Mazovetskiy b9c2f6ea1a Minor cleanup: Remove `using namespace std`
I came across these while trying to figure why MSVC build triggers
https://developercommunity.visualstudio.com/t/error-c2872-byte-ambiguous-symbol/93889

In the end, the issue was not in openmw but in OSG, but it's good to
clean up here anyway.
4 years ago
Andrei Kortunov 4d48c81998 Add move assignment operator and move constructor for the ESM::Variant 4 years ago
Andrei Kortunov f40e227686 Remove redundant formatting changes 4 years ago
Andrei Kortunov d12a0fdcb3 Mark only instances from groundcover files as groundcover objects 4 years ago
Andrei Kortunov 14cf0ce1dc Implement instanced groundcover 4 years ago
Andrei Kortunov 89f3f860ed Allow to get a rotation vector from ESM::Position 4 years ago
elsid 7b54415c40
Fix reference binding to null
/usr/include/c++/10.2.0/bits/stl_vector.h:1046:34: runtime error: reference binding to null pointer of type 'value_type'
    #0 0x55e37f50008a in std::vector<char, std::allocator<char> >::operator[](unsigned long) /usr/include/c++/10.2.0/bits/stl_vector.h:1046
    #1 0x55e37f50008a in ESM::SavedGame::load(ESM::ESMReader&) /home/elsid/dev/openmw/components/esm/savedgame.cpp:28
    #2 0x55e37e726139 in MWState::Character::addSlot(boost::filesystem::path const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/elsid/dev/openmw/apps/openmw/mwstate/character.cpp:31
    #3 0x55e37e742b39 in MWState::Character::Character(boost::filesystem::path const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/elsid/dev/openmw/apps/openmw/mwstate/character.cpp:88
    #4 0x55e37e7006e1 in MWState::CharacterManager::CharacterManager(boost::filesystem::path const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/elsid/dev/openmw/apps/openmw/mwstate/charactermanager.cpp:25
    #5 0x55e37e6d4140 in MWState::StateManager::StateManager(boost::filesystem::path const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/elsid/dev/openmw/apps/openmw/mwstate/statemanagerimp.cpp:90
    #6 0x55e37e82595a in OMW::Engine::prepareEngine(Settings::Manager&) /home/elsid/dev/openmw/apps/openmw/engine.cpp:641
    #7 0x55e37e8439fd in OMW::Engine::go() /home/elsid/dev/openmw/apps/openmw/engine.cpp:867
    #8 0x55e37e782760 in runApplication(int, char**) /home/elsid/dev/openmw/apps/openmw/main.cpp:289
    #9 0x55e37f6483c3 in wrapApplication(int (*)(int, char**), int, char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/elsid/dev/openmw/components/debug/debugging.cpp:200
    #10 0x55e37ba8e3fe in main /home/elsid/dev/openmw/apps/openmw/main.cpp:301
    #11 0x7f013e845151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
    #12 0x55e37baa0e3d in _start (/home/elsid/dev/openmw/build/gcc/ubsan/openmw+0x6c11e3d)
4 years ago
Andrei Kortunov 8084a336b5 Replace zeroes and nulls by nullptrs 4 years ago
Alexei Dobrohotov 53f91a3aa5
Merge pull request #3018 from akortunov/emplace
Use emplace_back instead of push_back
4 years ago
Andrei Kortunov 64ba81ecf2 Fix some issues, found by CoverityScan 4 years ago
Bret Curtis 5a824d0333 components/compiler cleanup; also cleaned up related cascading warnings; fixed up final/override issues 4 years ago
Andrei Kortunov 065ed5138e Use emplace_back instead of push_back 4 years ago
Andrei Kortunov 8ca3c3b123 Mark overrided methods by override keyword 4 years ago
Assumeru 72549651e0
Rework container resolution (#3006)
* Rework container resolution

* add optional argument to getCount

* remove now-redundant changes

* undo worldimp changes

* move save-fixing code to InventoryState

* replace Rng instances with Seeds
4 years ago
Andrei Kortunov 822764d0fa Rework fixed strings handling 4 years ago
Andrei Kortunov 9f1fbd56a3 Fix SummonKey comparison function 4 years ago
Andrei Kortunov 67eace1028 Use struct instead of tuple 4 years ago
Andrei Kortunov 924f634bda Support for multiple summons with same ID in the single spell 4 years ago
Evil Eye 6ad20ec9c7 Mutate base records when adding/removing spells 4 years ago
Andrei Kortunov d0fe15b095 Use meaningful names instead of mSkill1 and mSkill2 5 years ago
bzzt lost a hitlab login 26ab176389 profiling
Signed-off-by: Bret Curtis <psi29a@gmail.com>
5 years ago
Andrei Kortunov d997842f8d Use FourCC to declare all ESM record names 5 years ago
Bret Curtis cd97d0c61c
Merge branch 'master' into automove 5 years ago
Roman Siromakha 27a113167c
Merge pull request #2890 from akortunov/position
Do not store object position, if it is the same as in CellRef
5 years ago
Andrei Kortunov 75e7a3e8b1 Do not store object position, if it is the same as in CellRef 5 years ago
elsid 5209f5ff6d
Mark all derived classes from ESM::ObjectsState and overriden functions as final 5 years ago
Capostrophic 1873da4c91 Don't save to or read automove state from saved games (#5452) 5 years ago
Bret Curtis 204d2acf25
Merge pull request #2092 from akortunov/float_stats
Store attributes and skills values as floats
5 years ago
Andrei Kortunov 81805b7263 Introduce a separate class to control world date and time 5 years ago
Andrei Kortunov 5468fcb29f Store attributes and skills values as floats (bug #4021) 5 years ago
Andrei Kortunov 3dce225f28 Implement vanilla-style corprus handling (bug #3714, bug #4623) 5 years ago
Andrei Kortunov b5833f3c59 Use real time to update spell effects instead of game timestamps (bug #5165) 5 years ago
Andrei Kortunov e6ca95174a Optimize characters data in savegame 5 years ago
Andrei Kortunov d5806fd0ed Fix merge conflicts 5 years ago
Bret Curtis 42cba092b7
Merge pull request #2716 from akortunov/png
Store fog of war as a PNG image instead of TGA
5 years ago
Bret Curtis 4b30bf5699
Merge pull request #2829 from Capostrophic/logging
Log some more things
5 years ago
unknown 3b4782959e Allow targeting non-unique actors with StartScript (bug #2311) 5 years ago
Capostrophic aa5161f99e Log some more things 5 years ago
Bret Curtis e7795f2bf7
Merge pull request #2775 from Capostrophic/dooractivation
Only disarm traps with keys when the door/container is locked (bug #5370)
5 years ago
Bret Curtis 8c2f3ff007 clean up code; purge const_cast 5 years ago
Capostrophic bbed9a70c5 Ignore traps of initially unlocked refs with assigned keys 5 years ago
Capostrophic ad333e88fe Handle enchantment autocalc flag as a flag (bug #5363) 5 years ago
Andrei Kortunov 028760e108
Merge pull request #2758 from akortunov/warnfix
Fix some issues, found by CoverityScan
5 years ago
Capostrophic 5732b8e026 Use std::fill instead of loops to reset some arrays to defaults 5 years ago
Capostrophic 27d4fe9ee1 Fix ESM::Land oversights 5 years ago
Andrei Kortunov a68d9aed4c Fix issues, found by CoverityScan 5 years ago
elsid ef4a7089e4
Use template specialization for writeHNT to write raw arrays
To avoid passing explicit size argument where it's possible.
5 years ago
Andrei Kortunov e20d156904 Do not write empty trade time 5 years ago
Bret Curtis 79517f3f42
Merge pull request #2724 from akortunov/factions
Cleanup ownership for items in containers
5 years ago
Andrei Kortunov ea30e27370 Cleanup ownership for items in containers 5 years ago
Andrei Kortunov dea2018d9f Do not use dynamic casts when using ObjectState 5 years ago
Andrei Kortunov 94df2114c1 Store fog of war as a PNG image instead of TGA (bug #5108) 5 years ago
Capostrophic 216a5d27c6 Avoid working with AMBI subrecord in tools unnecessarily (bug #5269) 5 years ago
capostrophic 89055f1c6c Generate WNAM upon saving terrain 5 years ago
capostrophic 0467e8ee15 Avoid heap corruption while reading SCVR (bug #4680) 5 years ago
Alexei Dobrohotov 2693598d82
Merge pull request #2642 from akortunov/warnfix2
Add safety checks for door state
5 years ago
Andrei Kortunov 24044b08e0 Do not store gold-specific value for everything 5 years ago
Andrei Kortunov 88a695f251 Add safety checks for door state 5 years ago
Assumeru 737aa1e4e8 Remove FactionID editing from OpenCS (#2636)
* Remove FactionID editing

* remove useless comments

* rename FactionID to Unknown
5 years ago
Assumeru dfbe0021a5 Change rescaling to be more inline with vanilla (fixes #5214) (#2635)
* move rescaling to loadData

* clamp on save
5 years ago
Capostrophic 4b38bab0d9 Make sure empty cell name subrecords are saved (bug #5222) 5 years ago
Andrei Kortunov 6eb8e0cf4d Display magic effects according to research page 5 years ago
Bret Curtis 0ec4e51922
Revert "Store raw data about fog of war instead of RGBA images" 5 years ago
Bret Curtis 36614dba2a
Merge pull request #2453 from akortunov/fog_compression
Store raw data about fog of war instead of RGBA images
5 years ago
Andrei Kortunov b2e12f0a73 Attempt to fix a regression - crash on ARM 5 years ago
Andrei Kortunov 2fc819cdae Encode ID's in all places to UTF-8 (bug #3977) 5 years ago
Nelsson Huotari 2fdaacf23c remove for array, just std::swap 5 years ago
Nelsson Huotari e35ed960ee for -> std::copy 5 years ago
Nelsson Huotari 7f030fc3ee copy mWnam record in copy constructor and custom assignment operator 5 years ago
Andrei Kortunov b360deaec3 Store raw data about fog of war instead of RGBA images (bug #5108) 5 years ago
Andrei Kortunov f0cef772fa Refactor weapon types behaviour
1. Move weapon types behaviour from switches to the table (should allow
us to de-hardcode weapon types later)
2. Gereralize bones injection to actors skeletons (instead of using the
hardcoded xbase_anim_sh.nif)
5 years ago
Andrei Kortunov b9a1e4d796
Merge pull request #2425 from Capostrophic/esm
Signedness fixes
6 years ago
Capostrophic 3aa65273c5 Signedness fixes 6 years ago
Evil Eye 698c90b3ee fix builds against MyGUI master 6 years ago
Alexei Dobrohotov 2c956398c1
Actually fix bug 4938 6 years ago
Capostrophic 7814bd1b76 Support eight possible blood types (feature #4958) 6 years ago
Capostrophic 4b6fc5f720 Make sure the record hasn't ended in getHString hack (bug #4938) 6 years ago
elsid c91deaf7af
Use std::vector::data method to avoid reference binding to null pointer 6 years ago
Andrei Kortunov 943279abbb Consider land texture with given ID and index as override for base texture with the same ID and index (bug #4736) 6 years ago
Bret Curtis 56d5fc788c
Merge pull request #2163 from Capostrophic/hello
AI data handling minor revisions
6 years ago
Bret Curtis d4564a9be7
Merge pull request #2180 from akortunov/includes
Remove redundant includes
6 years ago
Bret Curtis 44920352ce
Merge pull request #2181 from Capostrophic/boost
Get rid of Boost.Array
6 years ago
Capostrophic 594ea39f5d Revise AI data handling
Make Hello 16-bit unsigned as it's intended to be
Get rid of redundant mHasAI boolean
Always save AI data subrecord
Adjust creature and NPC default rating values to Morrowind defaults
6 years ago
Bret Curtis 4a69d96483 Merge branch 'esm_name_template_fix' into 'master'
Make sure that proper operator function of ESM:FIXED_STRING is used for char[N] argument

See merge request OpenMW/openmw!63
6 years ago
Adam Fandrejewski 75c204cdd8 Fix #4835 - undefined behavior - uninitialized mCtx 6 years ago
Andrei Kortunov 3032b177a1 Remove redundant includes 6 years ago
Capostrophic 58788de7c4 Get rid of Boost.Array 6 years ago
Andrei Kortunov 573b3f4f1d Init target for AI packages from old saves 6 years ago
Azdul 7940317e42 Make sure that proper operator function is used for char[N] argument 6 years ago
Bret Curtis 8834ee95be
Merge pull request #2120 from Capostrophic/macros
Get rid of some remaining instances of C numeric limits
6 years ago
Capostrophic a71cfca580 Get rid of some remaining instances of C limit macros 6 years ago
Andrei Kortunov 0937f02598 Get rid of unnecessary string streams 6 years ago
Capostrophic d1e0a10136 Make sure AI data is initialized when loading actor records 6 years ago
Capostrophic 7155e787b4 Clean up fallback record creation 6 years ago
Capostrophic 4efe1bc892 Add prison marker record fallback definition (bug #4701) 6 years ago
jvoisin ca8744af56 Fix crash in the ESM reader, when SCVR has no variable names
Fixes bug [#4678](https://gitlab.com/OpenMW/openmw/issues/4678)
The `loadSCVR` method assumes that the list of variable
names won't be empty, which it might.
Instead of crashing, we show a warning and ignore the record.
6 years ago
Andrei Kortunov f9271fd7f0 Fix crash in the ESM reader, when list is empty (bug #4677) 6 years ago
Andrei Kortunov e06f0b797a Replace all NULLs to nullptr 6 years ago
Kyle Cooley 8444ee9981 Start rendering npc's 6 years ago
Andrei Kortunov 0176ee389e Handle length of UTF-8 strings properly in plugin metadata (bug #4653) 6 years ago
Andrei Kortunov 70ed8fd1a9 Use constants instead of widely used magic numbers (task #4645) 6 years ago
Andrei Kortunov d5bcc49079 Initialize missing struct fields 6 years ago
Capostrophic 65ff346b61 Make NPC record reputation, disposition and faction rank have unsigned char type 6 years ago
Marc Zinnschlag 78a84042ad Merged pull request #1901 6 years ago
Capostrophic 7ef6fa9f61 Remove deprecated GMST get* functions 6 years ago
Andrei Kortunov b0ac0b0b22 Do not initialize map every call 6 years ago
Andrei Kortunov 1452684d9e Use new logging system for components 6 years ago
Andrei Kortunov 359e748c28 Initialize some missing fields in constructors 7 years ago
Andrei Kortunov 5fd3ec1035 Implement unlockable locks with 'lock 0' console command 7 years ago
Andrei Kortunov acd3cba5fa Store previous items in the savegame 7 years ago
Marc Zinnschlag 7d9de93fd3 Merged pull request #1477 7 years ago
Andrei Kortunov 3d0631cfcc Store last AI package in savegame 7 years ago
Andrei Kortunov 3a0ee78d2b AiTravel: store mHidden flag in savegame 7 years ago
Andrei Kortunov fed10e87aa Store integer actor ID in AI packages (bug #4036) 7 years ago
Capostrophic eecde340cf Make weapon health short unsigned (fixes #4435) 7 years ago
Marc Zinnschlag d92d754834 Merged pull request #1697 7 years ago
Marc Zinnschlag b7cce1a665 Merged pull request #1702 7 years ago
Alf Henrik Sauge d4f278a113 Replacing tab with spaces 7 years ago
Alf Henrik Sauge feeee50a88 Dropping a separate NPDTstruct12 object and instead use NPDTstruct52
NPDTstruct12 is now only used when loading and saving. Turning auto calc
on and off now no longer switches between to different set of values
7 years ago
Andrei Kortunov 1dd36329a3 Load default markers definitions (bug #4410) 7 years ago
tri4ng1e f5b7a230fc
ESMReader::close now clears mHeader 7 years ago
tri4ng1e d4d1703bcf
Some PVS-Studio and cppcheck fixes
cppcheck:
[apps/esmtool/record.cpp:697]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/esmtool/record.cpp:1126]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/esmtool/record.cpp:1138]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/niftest/niftest.cpp:36]: (performance) Function parameter 'filename' should be passed by reference.
[apps/niftest/niftest.cpp:41]: (performance) Function parameter 'filename' should be passed by reference.
[apps/opencs/model/prefs/boolsetting.cpp:25]: (warning) Possible leak in public function. The pointer 'mWidget' is not deallocated before it is allocated.
[apps/opencs/model/prefs/shortcuteventhandler.cpp:52]: (warning) Return value of std::remove() ignored. Elements remain in container.
[apps/openmw/mwstate/quicksavemanager.cpp:5]: (performance) Variable 'mSaveName' is assigned in constructor body. Consider performing initialization in initialization list.

PVS-Studio:
apps/opencs/model/filter/parser.cpp  582  warn  V560 A part of conditional expression is always true: allowPredefined.
apps/opencs/view/world/referencecreator.cpp  67  warn  V547 Expression '!errors.empty()' is always false.
apps/opencs/view/world/referencecreator.cpp  74  warn  V547 Expression '!errors.empty()' is always false.
apps/opencs/view/doc/loader.cpp  170  warn  V560 A part of conditional expression is always true: !completed.
apps/opencs/view/doc/loader.cpp  170  warn  V560 A part of conditional expression is always true: !error.empty().
apps/opencs/model/tools/pathgridcheck.cpp  32  err  V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 32, 34.
apps/opencs/model/world/refidadapterimp.cpp  1376  err  V547 Expression 'subColIndex < 3' is always true.

apps/openmw/mwgui/widgets.hpp  318  warn  V703 It is odd that the 'mEnableRepeat' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:318, MyGUI_ScrollBar.h:179.
apps/openmw/mwgui/widgets.hpp  319  warn  V703 It is odd that the 'mRepeatTriggerTime' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:319, MyGUI_ScrollBar.h:180.
apps/openmw/mwgui/widgets.hpp  320  warn  V703 It is odd that the 'mRepeatStepTime' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:320, MyGUI_ScrollBar.h:181
apps/openmw/mwmechanics/actors.cpp  1425  warn  V547 Expression '!detected' is always true.
apps/openmw/mwmechanics/character.cpp  2155  err  V547 Expression 'mode == 0' is always true.
apps/openmw/mwmechanics/character.cpp  1192  warn  V592 The expression was enclosed by parentheses twice: ((expression)). One pair of parentheses is unnecessary or misprint is present.
apps/openmw/mwmechanics/character.cpp  521  warn  V560 A part of conditional expression is always true: (idle == mIdleState).
apps/openmw/mwmechanics/pathfinding.cpp  317  err  V547 Expression 'mPath.size() >= 2' is always true.
apps/openmw/mwscript/interpretercontext.cpp  409  warn  V560 A part of conditional expression is always false: rank > 9.
apps/openmw/mwgui/windowbase.cpp  28  warn  V560 A part of conditional expression is always true: !visible.
apps/openmw/mwgui/journalwindow.cpp  561  warn  V547 Expression '!mAllQuests' is always false.
apps/openmw/mwgui/referenceinterface.cpp  18  warn  V571 Recurring check. The '!mPtr.isEmpty()' condition was already verified in line 16.
apps/openmw/mwworld/scene.cpp  463  warn  V547 Expression 'adjustPlayerPos' is always true.
apps/openmw/mwworld/worldimp.cpp  409  err  V766 An item with the same key '"sCompanionShare"' has already been added.
apps/openmw/mwworld/cellstore.cpp  691  warn  V519 The 'state.mWaterLevel' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 689, 691.
apps/openmw/mwworld/weather.cpp  1125  warn  V519 The 'mResult.mParticleEffect' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1123, 1125.
apps/openmw/mwworld/weather.cpp  1137  warn  V519 The 'mResult.mParticleEffect' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1135, 1137.

apps/wizard/unshield/unshieldworker.cpp  475  warn  V728 An excessive check can be simplified. The '(A && B) || (!A && !B)' expression is equivalent to the 'bool(A) == bool(B)' expression.
apps/wizard/installationpage.cpp  163  warn  V735 Possibly an incorrect HTML. The "</p" closing tag was encountered, while the "</span" tag was expected.

components/fontloader/fontloader.cpp  427  err  V547 Expression 'i == 1' is always true.
components/nifosg/nifloader.cpp  282  warn  V519 The 'created' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 278, 282.
components/esm/loadregn.cpp  119  err  V586 The 'clear' function is called twice for deallocation of the same resource. Check lines: 112, 119.
components/esm/cellref.cpp  178  warn  V581 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 175, 178.
components/esmterrain/storage.cpp  235  warn  V560 A part of conditional expression is always true: colStart == 0.
components/esmterrain/storage.cpp  237  warn  V560 A part of conditional expression is always true: rowStart == 0.
7 years ago
Ilya Zhuravlev 9e9f6f3132 loadtes3: don't pack() non-POD structs 7 years ago
Marc Zinnschlag bdabace7e2 Merge remote-tracking branch 'aesylwinn/LLmerge' 7 years ago
Kyle Cooley 11eae16645 Get rid of duplicate function, fix flag checking 7 years ago
Andrei Kortunov 30b05b557b ExtraSpell magic effect: a basic implementation 7 years ago
Marc Zinnschlag dd17f70068 Merge remote-tracking branch 'aesylwinn/landrecords' 7 years ago
scrawl 64e27c032b Merge pull request #1481 from scrawl/keyfocus
WindowManager overhaul & improved keyboard support
7 years ago
scrawl 19e07fad30 Remove redundant Services enum 7 years ago
scrawl 82a211ba03 Fix duplicate code 7 years ago
MiroslavR f15de6d3ca ESS-Importer: Convert magic projectiles (Closes #2320) 7 years ago
Kyle Cooley 50d9d9f78f Get rid of some templates, exceptions instead of assert, and other small changes. 7 years ago
Kyle Cooley 09e645a0e0 Fix careless mistake. 7 years ago
Kyle Cooley 25d4a0370f Changes to land data access in tables, also update Land once per frame in scene view. 7 years ago
Kyle Cooley d030b595f8 Fix potential segfault, cleanup, get rid of warnings. 7 years ago
Kyle Cooley 72cb405de2 Some bug fixes, changes to land load code. 7 years ago
Kyle Cooley ab607f3028 Tweaks to land loading, land cloning, terrain signals, placeholder land update handling 7 years ago
Kyle Cooley d3014cf394 Temporary fix for adding new lands, cloned lands will still reference old data though 7 years ago
Kyle Cooley 7cc95a11a4 Add more land table columns 7 years ago
Kyle Cooley 9e41f1340a Replace nonconst getId with setId, add template specialization and specialized derived classes for LandTexture 7 years ago
Andrei Kortunov 2bd105f5e2 Change mValue type for clothes to unsigned short (fixes #3960) 8 years ago
Bret Curtis d48b829b45 replace and purge boost::lexical_cast 8 years ago
Bret Curtis d785344fad purge all instances of <boost/shared_ptr.hpp>, clean up unused headers 8 years ago
Ewan Higgs 38a2de3c51 convert std::autor_ptr to std::unique_ptr, originally by Ewan Higgs and updated by Bret Curtis 8 years ago
Allofich ff3e307059 Pass parameters by const reference 8 years ago
Allofich 2a505b427d Remove second LAND_SIZE definition 8 years ago
MiroslavR 06dc94552f Log a warning if size in SCHD (script header) does not match SCDT (bytecode) size instead of failing 8 years ago
scrawl b384087e28 Fix handling in fillVertexBuffers when the chunk is >1 ESM::Cell 8 years ago
scrawl 0fc465da59 Store the min/max height in LandData 8 years ago
scrawl 80a0398f9d Load LandData into the LandObject to avoid threading conflicts when the same data is being loaded by two threads 8 years ago
scrawl 20d30bb8d7 Move mDataLoaded into LandData 8 years ago
scrawl 29556a1802 More consistent wording of errors/warnings
A Warning indicates a potential problem in the content file(s) that the user told OpenMW to load. E.g. this might cause an object to not display at all or as intended, however the rest of the game will run fine.

An Error, however, is more likely to be a bug with the engine itself - it means that basic assumptions have been violated and the engine might not run correctly anymore.

The above mostly applies to errors/warnings during game-play; startup issues are handled differently: when a file is completely invalid/corrupted to the point that the engine can not start, that might cause messages that are worded as Error due to the severity of the issue but are not necessarily the engine's fault.

Hopefully, being a little more consistent here will alleviate confusion among users as to when a log message should be reported and to whom.
8 years ago
scrawl ddd6605608 Move WNAM out of LandData to avoid redundant (de)allocations on startup 8 years ago
scrawl e00b420f68 Move saving of LandData into Land::save 8 years ago
scrawl 325bf66653 Return const Land in ESMStore 8 years ago
MAtahualpa b4ef9e2314 Update loadbook.cpp 8 years ago
MAtahualpa 5a58ab1837 Update loadbook.hpp 8 years ago
scrawl bbcba57495 Disable hitAttemptActorId saving code for now 8 years ago
scrawl 2ea0db1d1a Merge pull request #1198 from Allofich/combat
Make combat engagement logic more like vanilla
8 years ago
scrawl d3e1dbe920 Fix race conditions in terrain loader caused by static variables 8 years ago
Allofich 5d2090684a Store mHitAttemptActorId in save files 8 years ago
mrohrlach f0f78c9d64 Slight adjustments to disintegration fix 8 years ago
mrohrlach 9624d8aade Added new method and variable to track float remainders of disintegration effections 8 years ago
scrawl 505250f6ec Do not use architecture dependent type size_t in esm format (Fixes #3633) 8 years ago
Assumeru f6ef1ce276 Fix Calm/Frenzy/Demoralize/Rally Creature weakness and resistance 8 years ago
MiroslavR 301dd77efb Save controls state (Fixes #3598) 8 years ago
Allofich f6f16b68de Don't let Weakness to Magicka affect paralysis 8 years ago
Allofich 498976775a Fix reversed use of alembics and retorts 8 years ago
MiroslavR 55e670c5fe Fix animation state not saving
References with animation state changed but otherwise identical to their content file counterparts
were previously considered unchanged and thus dropped while saving.
8 years ago
scrawl a5da3a269e Fix shadowing warnings 8 years ago
MiroslavR b65f379b7f Save scripted animation state (Fixes #1931, #2150, #3393) 9 years ago
MiroslavR d790747389 Implement deletion of moved references (Bug #3471) 9 years ago