diff --git a/CMakeLists.txt b/CMakeLists.txt index 745141502..a33c5dc6e 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 29) +set(OPENMW_VERSION_MINOR 30) set(OPENMW_VERSION_RELEASE 0) set(OPENMW_VERSION_COMMITHASH "") diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index 8a58b7d32..52e7afefd 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -86,8 +86,11 @@ namespace CSVRender } std::stringstream windowHandle; +#ifdef WIN32 + windowHandle << Ogre::StringConverter::toString((unsigned long)(this->winId())); +#else windowHandle << this->winId(); - +#endif std::stringstream windowTitle; static int count=0; windowTitle << ++count; diff --git a/apps/openmw/mwmechanics/aisequence.cpp b/apps/openmw/mwmechanics/aisequence.cpp index a4dd05ed3..4d36fdc4d 100644 --- a/apps/openmw/mwmechanics/aisequence.cpp +++ b/apps/openmw/mwmechanics/aisequence.cpp @@ -141,17 +141,34 @@ void AiSequence::execute (const MWWorld::Ptr& actor,float duration) { if ((*it)->getTypeId() != AiPackage::TypeIdCombat) break; - ESM::Position &targetPos = static_cast(*it)->getTarget().getRefData().getPosition(); + MWWorld::Ptr target = static_cast(*it)->getTarget(); - float distTo = (Ogre::Vector3(targetPos.pos) - vActorPos).length(); - if (distTo < nearestDist) + // target disappeared (e.g. summoned creatures) + if (target.isEmpty()) { - nearestDist = distTo; - itActualCombat = it; + delete *it; + mPackages.erase(it++); + } + else + { + ESM::Position &targetPos = target.getRefData().getPosition(); + + float distTo = (Ogre::Vector3(targetPos.pos) - vActorPos).length(); + if (distTo < nearestDist) + { + nearestDist = distTo; + itActualCombat = it; + } } } - if (mPackages.begin() != itActualCombat) + // all targets disappeared + if (nearestDist == std::numeric_limits::max()) + { + mDone = true; + return; + } + else if (mPackages.begin() != itActualCombat) { // move combat package with nearest target to the front mPackages.splice(mPackages.begin(), mPackages, itActualCombat); diff --git a/readme.txt b/readme.txt index 4db9425b6..92cb35f31 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.29.0 +Version: 0.30.0 License: GPL (see GPL3.txt for more information) Website: http://www.openmw.org