From d6050191110c813481e4005dc8fe391e8850e14b Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 28 Aug 2014 14:09:12 +0200 Subject: [PATCH 01/12] updated changelog --- readme.txt | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) diff --git a/readme.txt b/readme.txt index a02cc4ebc5..332bb2db72 100644 --- a/readme.txt +++ b/readme.txt @@ -96,6 +96,151 @@ Allowed options: CHANGELOG +0.32.0 + +Bug #1132: Unable to jump when facing a wall +Bug #1341: Summoned Creatures do not immediately disappear when killed. +Bug #1430: CharGen Revamped script does not compile +Bug #1451: NPCs shouldn't equip weapons prior to fighting +Bug #1461: Stopped start scripts do not restart on load +Bug #1473: Dead NPC standing and in 2 pieces +Bug #1482: Abilities are depleted when interrupted during casting +Bug #1503: Behaviour of NPCs facing the player +Bug #1506: Missing character, French edition: three-points +Bug #1528: Inventory very slow after 2 hours +Bug #1540: Extra arguments should be ignored for script functions +Bug #1541: Helseth's Champion: Tribunal +Bug #1570: Journal cannot be opened while in inventory screen +Bug #1573: PC joins factions at random +Bug #1576: NPCs aren't switching their weapons when out of ammo +Bug #1579: Guards detect creatures in far distance, instead on sight +Bug #1588: The Siege of the Skaal Village: bloodmoon +Bug #1593: The script compiler isn't recognising some names that contain a - +Bug #1606: Books: Question marks instead of quotation marks +Bug #1608: Dead bodies prevent door from opening/closing. +Bug #1609: Imperial guards in Sadrith Mora are not using their spears +Bug #1610: The bounty number is not displayed properly with high numbers +Bug #1620: Implement correct formula for auto-calculated NPC spells +Bug #1630: Boats standing vertically in Vivec +Bug #1635: Arrest dialogue is executed second time after I select "Go to jail" +Bug #1637: Weird NPC behaviour in Vivec, Hlaalu Ancestral Vaults? +Bug #1641: Persuasion dialog remains after loading, possibly resulting in crash +Bug #1644: "Goodbye" and similar options on dialogues prevents escape working properly. +Bug #1646: PC skill stats are not updated immediately when changing equipment +Bug #1652: Non-aggressive creature +Bug #1653: Quickloading while the container window is open crashes the game +Bug #1654: Priority of checks in organic containers +Bug #1656: Inventory items merge issue when repairing +Bug #1657: Attacked state of NPCs is not saved properly +Bug #1660: Rank dialogue condition ignored +Bug #1668: Game starts on day 2 instead of day 1 +Bug #1669: Critical Strikes while fighting a target who is currently fighting me +Bug #1672: OpenCS doesn't save the projects +Bug #1673: Fatigue decreasing by only one point when running +Bug #1675: Minimap and localmap graphic glitches +Bug #1676: Pressing the OK button on the travel menu cancels the travel and exits the menu +Bug #1677: Sleeping in a rented bed is considered a crime +Bug #1685: NPCs turn towards player even if invisible/sneaking +Bug #1686: UI bug: cursor is clicking "world/local" map button while inventory window is closed? +Bug #1690: Double clicking on a inventory window header doesn't close it. +Bug #1693: Spell Absorption does not absorb shrine blessings +Bug #1694: journal displays learned topics as quests +Bug #1700: Sideways scroll of text boxes +Bug #1701: Player enchanting requires player hold money, always 100% sucessful. +Bug #1704: self-made Fortify Intelligence/Drain willpower potions are broken +Bug #1707: Pausing the game through the esc menu will silence rain, pausing it by opening the inventory will not. +Bug #1709: Remesa Othril is hostile to Hlaalu members +Bug #1713: Crash on load after death +Bug #1719: Blind effect has slight border at the edge of the screen where it is ineffective. +Bug #1722: Crash after creating enchanted item, reloading saved game +Bug #1723: Content refs that are stacked share the same index after unstacking +Bug #1726: Can't finish Aengoth the Jeweler's quest : Retrieve the Scrap Metal +Bug #1727: Targets almost always resist soultrap scrolls +Bug #1728: Casting a soultrap spell on invalid target yields no message +Bug #1729: Chop attack doesn't work if walking diagonally +Bug #1732: Error handling for missing script function arguments produces weird message +Bug #1736: Alt-tabbing removes detail from overworld map. +Bug #1737: Going through doors with (high magnitude?) leviation will put the player high up, possibly even out of bounds. +Bug #1739: Setting a variable on an NPC from another NPC's dialogue result sets the wrong variable +Bug #1741: The wait dialogue doesn't black the screen out properly during waiting. +Bug #1742: ERROR: Object 'sDifficulty' not found (const) +Bug #1744: Night sky in Skies V.IV (& possibly v3) by SWG rendered incorrectly +Bug #1746: Bow/marksman weapon condition does not degrade with use +Bug #1749: Constant Battle Music +Bug #1752: Alt-Tabbing in the character menus makes the paper doll disappear temporarily +Bug #1753: Cost of training is not added to merchant's inventory +Bug #1755: Disposition changes do not persist if the conversation menu is closed by purchasing training. +Bug #1756: Caught Blight after being cured of Corprus +Bug #1758: Crash Upon Loading New Cell +Bug #1760: Player's Magicka is not recalculated upon drained or boosted intelligence +Bug #1761: Equiped torches lost on reload +Bug #1762: Your spell did not get a target. Soul trap. Gorenea Andrano +Bug #1763: Custom Spell Magicka Cost +Bug #1765: Azuras Star breaks on recharging item +Bug #1767: GetPCRank did not handle ignored explicit references +Bug #1772: Dark Brotherhood Assassins never use their Carved Ebony Dart, sticking to their melee weapon. +Bug #1774: String table overflow also occurs when loading TheGloryRoad.esm +Bug #1776: dagoth uthol runs in slow motion +Bug #1778: Incorrect values in spellmaking window +Bug #1779: Icon of Master Propylon Index is not visible +Bug #1783: Invisible NPC after looting corpse +Bug #1787: Health Calculation +Bug #1788: Skeletons, ghosts etc block doors when we try to open +Bug #1791: [MOD: LGNPC Foreign Quarter] NPC in completely the wrong place. +Bug #1792: Potions should show more effects +Bug #1793: Encumbrance while bartering +Bug #1794: Fortify attribute not affecting fatigue +Bug #1795: Too much magicka +Bug #1796: "Off by default" torch burning +Bug #1797: Fish too slow +Bug #1798: Rest until healed shouldn't show with full health and magicka +Bug #1802: Mark location moved +Bug #1804: stutter with recent builds +Bug #1810: attack gothens dremora doesnt agro the others. +Bug #1811: Regression: Crash Upon Loading New Cell +Bug #1812: Mod: "QuickChar" weird button placement +Bug #1815: Keys show value and weight, Vanilla Morrowind's keys dont. +Bug #1817: Persuasion results do not show using unpatched MW ESM +Bug #1818: Quest B3_ZainabBride moves to stage 47 upon loading save while Falura Llervu is following +Bug #1823: AI response to theft incorrect - only guards react, in vanilla everyone does. +Bug #1829: On-Target Spells Rendered Behind Water Surface Effects +Bug #1830: Galsa Gindu's house is on fire +Bug #1832: Fatal Error: OGRE Exception(2:InvalidParametersException) +Bug #1836: Attacked Guards open "fine/jail/resist"-dialogue after killing you +Bug #1840: Infinite recursion in ActionTeleport +Bug #1843: Escorted people change into player's cell after completion of escort stage +Bug #1845: Typing 'j' into 'Name' fields opens the journal +Bug #1846: Text pasted into the console still appears twice (Windows) +Bug #1847: "setfatigue 0" doesn't render NPC unconscious +Bug #1848: I can talk to unconscious actors +Feature #47: Magic Effects +Feature #642: Control NPC mouth movement using current Say sound +Feature #939: Editor: Resources tables +Feature #961: AI Combat for magic (spells, potions and enchanted items) +Feature #1111: Collision script instructions (used e.g. by Lava) +Feature #1120: Command creature/humanoid magic effects +Feature #1121: Elemental shield magic effects +Feature #1122: Light magic effect +Feature #1139: AI: Friendly hits +Feature #1141: AI: combat party +Feature #1326: Editor: Add tooltips to all graphical buttons +Feature #1489: Magic effect Get/Mod/Set functions +Feature #1505: Difficulty slider +Feature #1538: Targeted scripts +Feature #1571: Allow creating custom markers on the local map +Feature #1615: Determine local variables from compiled scripts instead of the values in the script record +Feature #1616: Editor: Body part record verifier +Feature #1651: Editor: Improved keyboard navigation for scene toolbar +Feature #1666: Script blacklisting +Feature #1711: Including the Git revision number from the command line "--version" switch. +Feature #1721: NPC eye blinking +Feature #1740: Scene toolbar buttons for selecting which type of elements are rendered +Feature #1790: Mouse wheel scrolling for the journal +Feature #1850: NiBSPArrayController +Task #768: On windows, settings folder should be "OpenMW", not "openmw" +Task #908: Share keyframe data +Task #1716: Remove defunct option for building without FFmpeg + 0.31.0 Bug #245: Cloud direction and weather systems differ from Morrowind From 3f503c656130ef0266107eac4fcb00dc6bf12ae5 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 28 Aug 2014 16:31:06 +0200 Subject: [PATCH 02/12] Fix mSelectedEnchantItem cleanup not working for non-player actors --- apps/openmw/mwworld/inventorystore.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index 7ea4a0bf1d..efb6e1b65f 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -490,7 +490,7 @@ int MWWorld::InventoryStore::remove(const Ptr& item, int count, const Ptr& actor } if (item.getRefData().getCount() == 0 && mSelectedEnchantItem != end() - && *mSelectedEnchantItem == item && actor.getRefData().getHandle() == "player") + && *mSelectedEnchantItem == item) { mSelectedEnchantItem = end(); } @@ -521,11 +521,11 @@ MWWorld::ContainerStoreIterator MWWorld::InventoryStore::unequipSlot(int slot, c const std::string& script = it->getClass().getScript(*it); if (script != "") (*it).getRefData().getLocals().setVarByInt(script, "onpcequip", 0); + } - if ((mSelectedEnchantItem != end()) && (mSelectedEnchantItem == it)) - { - mSelectedEnchantItem = end(); - } + if ((mSelectedEnchantItem != end()) && (mSelectedEnchantItem == it)) + { + mSelectedEnchantItem = end(); } } From 927dcc7cdd736569adef204e52338301c4338bc8 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 28 Aug 2014 16:47:54 +0200 Subject: [PATCH 03/12] Another invalid iterator fix --- apps/openmw/mwmechanics/aicombat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/aicombat.cpp b/apps/openmw/mwmechanics/aicombat.cpp index 4d9e0571a5..d484071bf6 100644 --- a/apps/openmw/mwmechanics/aicombat.cpp +++ b/apps/openmw/mwmechanics/aicombat.cpp @@ -770,7 +770,7 @@ void getMinMaxAttackDuration(const MWWorld::Ptr& actor, float (*fMinMaxDurations // get weapon information: type and speed const ESM::Weapon *weapon = NULL; - MWMechanics::WeaponType weaptype; + MWMechanics::WeaponType weaptype = MWMechanics::WeapType_None; MWWorld::ContainerStoreIterator weaponSlot = MWMechanics::getActiveWeapon(actor.getClass().getCreatureStats(actor), actor.getClass().getInventoryStore(actor), &weaptype); From 84ad05b4faa08898d550c83408cdcd4efff34382 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 28 Aug 2014 17:02:11 +0200 Subject: [PATCH 04/12] Fix bone not found exception for golden saint spellcasting --- apps/openmw/mwmechanics/character.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index aca8d988cf..de3714f756 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -870,10 +870,16 @@ bool CharacterController::updateWeaponState() mAnimation->addEffect("meshes\\" + castStatic->mModel, effect->mIndex); castStatic = MWBase::Environment::get().getWorld()->getStore().get().find ("VFX_Hands"); - //mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Bip01 L Hand", effect->mParticle); - //mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Bip01 R Hand", effect->mParticle); - mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Left Hand", effect->mParticle); - mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Right Hand", effect->mParticle); + if (mAnimation->getNode("Left Hand")) + { + mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Left Hand", effect->mParticle); + mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Right Hand", effect->mParticle); + } + else + { + mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Bip01 L Hand", effect->mParticle); + mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Bip01 R Hand", effect->mParticle); + } switch(effectentry.mRange) { From b6a3541573128e99b2f899aefd7930a5257b2bea Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 29 Aug 2014 10:03:49 +0200 Subject: [PATCH 05/12] increased version number --- CMakeLists.txt | 2 +- readme.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47575e0ce5..71a9c25aec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) message(STATUS "Configuring OpenMW...") set(OPENMW_VERSION_MAJOR 0) -set(OPENMW_VERSION_MINOR 31) +set(OPENMW_VERSION_MINOR 32) set(OPENMW_VERSION_RELEASE 0) set(OPENMW_VERSION_COMMITHASH "") diff --git a/readme.txt b/readme.txt index 332bb2db72..f4e0932f24 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ OpenMW: A reimplementation of The Elder Scrolls III: Morrowind OpenMW is an attempt at recreating the engine for the popular role-playing game Morrowind by Bethesda Softworks. You need to own and install the original game for OpenMW to work. -Version: 0.31.0 +Version: 0.32.0 License: GPL (see GPL3.txt for more information) Website: http://www.openmw.org From 0f290493e95d4c2a426e46d6951427e6229d0da4 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 30 Aug 2014 18:48:28 +0200 Subject: [PATCH 06/12] Fix summoned creatures not following for non-player summoners --- apps/openmw/mwmechanics/actors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index a94f26cd44..a039c82327 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -753,7 +753,7 @@ namespace MWMechanics MWMechanics::CreatureStats& summonedCreatureStats = ref.getPtr().getClass().getCreatureStats(ref.getPtr()); // Make the summoned creature follow its master and help in fights - AiFollow package(ptr.getRefData().getHandle()); + AiFollow package(ptr.getCellRef().getRefId()); summonedCreatureStats.getAiSequence().stack(package, ref.getPtr()); int creatureActorId = summonedCreatureStats.getActorId(); From 20c5857f34645d342f04bfc909b546a6a8bfa16f Mon Sep 17 00:00:00 2001 From: Corporama Date: Sat, 30 Aug 2014 23:11:09 +0200 Subject: [PATCH 07/12] Compile fixes for Linux --- apps/openmw/mwmechanics/mechanicsmanagerimp.cpp | 2 ++ extern/sdl4ogre/sdlwindowhelper.cpp | 1 + libs/openengine/bullet/physic.hpp | 3 +-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index d0f11b892b..b6b2c213d6 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -21,6 +21,8 @@ #include "spellcasting.hpp" #include "autocalcspell.hpp" +#include + namespace { /// @return is \a ptr allowed to take/use \a item or is it a crime? diff --git a/extern/sdl4ogre/sdlwindowhelper.cpp b/extern/sdl4ogre/sdlwindowhelper.cpp index f30362d789..e040b88681 100644 --- a/extern/sdl4ogre/sdlwindowhelper.cpp +++ b/extern/sdl4ogre/sdlwindowhelper.cpp @@ -6,6 +6,7 @@ #include #include +#include #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE #include "osx_utils.h" diff --git a/libs/openengine/bullet/physic.hpp b/libs/openengine/bullet/physic.hpp index d846d60b1b..d882d85bb0 100644 --- a/libs/openengine/bullet/physic.hpp +++ b/libs/openengine/bullet/physic.hpp @@ -8,8 +8,7 @@ #include #include "BulletShapeLoader.h" #include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h" - - +#include class btRigidBody; class btBroadphaseInterface; From 58f92f3659d1195030db701f3a5ade5ddd20c812 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 3 Sep 2014 04:54:07 +0200 Subject: [PATCH 08/12] Pause frame updates when the window is minimized (Fixes #1868) --- apps/openmw/engine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 21d0a25111..fa4c693375 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -86,6 +86,11 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt) // update input MWBase::Environment::get().getInputManager()->update(frametime, false); + // When the window is minimized, pause everything. Currently this *has* to be here to work around a MyGUI bug. + // If we are not currently rendering, then RenderItems will not be reused resulting in a memory leak upon changing widget textures. + if (!mOgre->getWindow()->isActive() || !mOgre->getWindow()->isVisible()) + return true; + // sound if (mUseSound) MWBase::Environment::get().getSoundManager()->update(frametime); From c44f9bfca999679283f1ba8e94a7bb766e6b4219 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 3 Sep 2014 18:16:33 +0200 Subject: [PATCH 09/12] updated changelog --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index f4e0932f24..3507a0d6ef 100644 --- a/readme.txt +++ b/readme.txt @@ -213,6 +213,7 @@ Bug #1845: Typing 'j' into 'Name' fields opens the journal Bug #1846: Text pasted into the console still appears twice (Windows) Bug #1847: "setfatigue 0" doesn't render NPC unconscious Bug #1848: I can talk to unconscious actors +Bug #1868: Memory leaking when openmw window is minimized Feature #47: Magic Effects Feature #642: Control NPC mouth movement using current Say sound Feature #939: Editor: Resources tables From db879e77c24b5cf91e34aef984261f145f89587a Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 5 Sep 2014 17:17:45 +0200 Subject: [PATCH 10/12] Handle death in actor update rather than instantly (Fixes #1866) --- apps/openmw/mwbase/mechanicsmanager.hpp | 5 ++--- apps/openmw/mwmechanics/actors.cpp | 17 ++------------ apps/openmw/mwmechanics/actors.hpp | 5 ++--- apps/openmw/mwmechanics/creaturestats.cpp | 15 ++++++------- apps/openmw/mwmechanics/creaturestats.hpp | 2 ++ .../mwmechanics/mechanicsmanagerimp.cpp | 22 ++++++++++++++----- .../mwmechanics/mechanicsmanagerimp.hpp | 4 +--- 7 files changed, 33 insertions(+), 37 deletions(-) diff --git a/apps/openmw/mwbase/mechanicsmanager.hpp b/apps/openmw/mwbase/mechanicsmanager.hpp index 532c1c3faa..e99f4ca3cd 100644 --- a/apps/openmw/mwbase/mechanicsmanager.hpp +++ b/apps/openmw/mwbase/mechanicsmanager.hpp @@ -198,9 +198,8 @@ namespace MWBase /// making it more likely for the function to return true. virtual bool isAggressive (const MWWorld::Ptr& ptr, const MWWorld::Ptr& target, int bias=0, bool ignoreDistance=false) = 0; - /// Usually done once a frame, but can be invoked manually in time-critical situations. - /// This will increase the death count for any actors that were killed. - virtual void killDeadActors() = 0; + /// Resurrects the player if necessary + virtual void keepPlayerAlive() = 0; }; } diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index a039c82327..2f73520162 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -1282,23 +1282,10 @@ namespace MWMechanics continue; } - // If it's the player and God Mode is turned on, keep it alive - if (iter->first.getRefData().getHandle()=="player" && - MWBase::Environment::get().getWorld()->getGodModeState()) - { - MWMechanics::DynamicStat stat (stats.getHealth()); - - if (stat.getModified()<1) - { - stat.setModified(1, 0); - stats.setHealth(stat); - } - stats.resurrect(); - continue; - } - if (iter->second->kill()) { + iter->first.getClass().getCreatureStats(iter->first).notifyDied(); + ++mDeathCount[Misc::StringUtils::lowerCase(iter->first.getCellRef().getRefId())]; // Make sure spell effects with CasterLinked flag are removed diff --git a/apps/openmw/mwmechanics/actors.hpp b/apps/openmw/mwmechanics/actors.hpp index f893f7596a..55f1719f62 100644 --- a/apps/openmw/mwmechanics/actors.hpp +++ b/apps/openmw/mwmechanics/actors.hpp @@ -44,6 +44,8 @@ namespace MWMechanics void updateCrimePersuit (const MWWorld::Ptr& ptr, float duration); + void killDeadActors (); + public: Actors(); @@ -98,9 +100,6 @@ namespace MWMechanics int countDeaths (const std::string& id) const; ///< Return the number of deaths for actors with the given ID. - ///@see MechanicsManager::killDeadActors - void killDeadActors (); - void forceStateUpdate(const MWWorld::Ptr &ptr); void playAnimationGroup(const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number); diff --git a/apps/openmw/mwmechanics/creaturestats.cpp b/apps/openmw/mwmechanics/creaturestats.cpp index 6c0356a040..7a2ece6cad 100644 --- a/apps/openmw/mwmechanics/creaturestats.cpp +++ b/apps/openmw/mwmechanics/creaturestats.cpp @@ -188,16 +188,10 @@ namespace MWMechanics if (index==0 && mDynamic[index].getCurrent()<1) { - if (!mDead) - mDied = true; - mDead = true; - if (mDied) - // Must increase death count immediately. There are scripts that use getDeadCount as reaction to onDeath - // and rely on the increased value. - // Would be more appropriate to use a killActor(actor) function, but we don't have access to the Ptr in CreatureStats. - MWBase::Environment::get().getMechanicsManager()->killDeadActors(); + if (MWBase::Environment::get().getWorld()->getGodModeState()) + MWBase::Environment::get().getMechanicsManager()->keepPlayerAlive(); } } @@ -242,6 +236,11 @@ namespace MWMechanics return mDead; } + void CreatureStats::notifyDied() + { + mDied = true; + } + bool CreatureStats::hasDied() const { return mDied; diff --git a/apps/openmw/mwmechanics/creaturestats.hpp b/apps/openmw/mwmechanics/creaturestats.hpp index 037f37cc91..827408e111 100644 --- a/apps/openmw/mwmechanics/creaturestats.hpp +++ b/apps/openmw/mwmechanics/creaturestats.hpp @@ -168,6 +168,8 @@ namespace MWMechanics bool isDead() const; + void notifyDied(); + bool hasDied() const; void clearHasDied(); diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index b6b2c213d6..8547188637 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -664,11 +664,6 @@ namespace MWMechanics return mActors.countDeaths (id); } - void MechanicsManager::killDeadActors() - { - mActors.killDeadActors(); - } - void MechanicsManager::getPersuasionDispositionChange (const MWWorld::Ptr& npc, PersuasionType type, float currentTemporaryDispositionDelta, bool& success, float& tempChange, float& permChange) { @@ -1303,4 +1298,21 @@ namespace MWMechanics return (fight >= 100); } + + void MechanicsManager::keepPlayerAlive() + { + MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr(); + CreatureStats& stats = player.getClass().getCreatureStats(player); + if (stats.isDead()) + { + MWMechanics::DynamicStat stat (stats.getHealth()); + + if (stat.getModified()<1) + { + stat.setModified(1, 0); + stats.setHealth(stat); + } + stats.resurrect(); + } + } } diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.hpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.hpp index 7dbc6da74f..48553e099f 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.hpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.hpp @@ -162,9 +162,7 @@ namespace MWMechanics /// making it more likely for the function to return true. virtual bool isAggressive (const MWWorld::Ptr& ptr, const MWWorld::Ptr& target, int bias=0, bool ignoreDistance=false); - /// Usually done once a frame, but can be invoked manually in time-critical situations. - /// This will increase the death count for any actors that were killed. - virtual void killDeadActors(); + virtual void keepPlayerAlive(); }; } From b2e8d61b43a38b6107e16e91ed634968343c84d8 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 6 Sep 2014 10:28:23 +0200 Subject: [PATCH 11/12] updated changelog --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 3507a0d6ef..d66206df55 100644 --- a/readme.txt +++ b/readme.txt @@ -213,6 +213,7 @@ Bug #1845: Typing 'j' into 'Name' fields opens the journal Bug #1846: Text pasted into the console still appears twice (Windows) Bug #1847: "setfatigue 0" doesn't render NPC unconscious Bug #1848: I can talk to unconscious actors +Bug #1866: Crash when player gets killed by a creature summoned by him Bug #1868: Memory leaking when openmw window is minimized Feature #47: Magic Effects Feature #642: Control NPC mouth movement using current Say sound From 14f32563e78a71f36b3b14169040729b86033452 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 9 Sep 2014 13:55:10 +0200 Subject: [PATCH 12/12] fixed script compiler code ordering issue --- components/compiler/lineparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/compiler/lineparser.cpp b/components/compiler/lineparser.cpp index 2f835924d1..c5e236f147 100644 --- a/components/compiler/lineparser.cpp +++ b/components/compiler/lineparser.cpp @@ -307,7 +307,7 @@ namespace Compiler std::vector code; optionals = mExprParser.parseArguments (argumentType, scanner, code); - mCode.insert (mCode.begin(), code.begin(), code.end()); + mCode.insert (mCode.end(), code.begin(), code.end()); extensions->generateInstructionCode (keyword, mCode, mLiterals, mExplicit, optionals); }