Merge branch 'master' of https://github.com/OpenMW/openmw into newgame

This commit is contained in:
scrawl 2014-05-21 10:41:03 +02:00
commit 2f6d400c62
4 changed files with 29 additions and 9 deletions

View file

@ -12,7 +12,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/)
message(STATUS "Configuring OpenMW...") message(STATUS "Configuring OpenMW...")
set(OPENMW_VERSION_MAJOR 0) set(OPENMW_VERSION_MAJOR 0)
set(OPENMW_VERSION_MINOR 29) set(OPENMW_VERSION_MINOR 30)
set(OPENMW_VERSION_RELEASE 0) set(OPENMW_VERSION_RELEASE 0)
set(OPENMW_VERSION_COMMITHASH "") set(OPENMW_VERSION_COMMITHASH "")

View file

@ -86,8 +86,11 @@ namespace CSVRender
} }
std::stringstream windowHandle; std::stringstream windowHandle;
#ifdef WIN32
windowHandle << Ogre::StringConverter::toString((unsigned long)(this->winId()));
#else
windowHandle << this->winId(); windowHandle << this->winId();
#endif
std::stringstream windowTitle; std::stringstream windowTitle;
static int count=0; static int count=0;
windowTitle << ++count; windowTitle << ++count;

View file

@ -141,17 +141,34 @@ void AiSequence::execute (const MWWorld::Ptr& actor,float duration)
{ {
if ((*it)->getTypeId() != AiPackage::TypeIdCombat) break; if ((*it)->getTypeId() != AiPackage::TypeIdCombat) break;
ESM::Position &targetPos = static_cast<const AiCombat *>(*it)->getTarget().getRefData().getPosition(); MWWorld::Ptr target = static_cast<const AiCombat *>(*it)->getTarget();
float distTo = (Ogre::Vector3(targetPos.pos) - vActorPos).length(); // target disappeared (e.g. summoned creatures)
if (distTo < nearestDist) if (target.isEmpty())
{ {
nearestDist = distTo; delete *it;
itActualCombat = 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<float>::max())
{
mDone = true;
return;
}
else if (mPackages.begin() != itActualCombat)
{ {
// move combat package with nearest target to the front // move combat package with nearest target to the front
mPackages.splice(mPackages.begin(), mPackages, itActualCombat); mPackages.splice(mPackages.begin(), mPackages, itActualCombat);

View file

@ -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 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. 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) License: GPL (see GPL3.txt for more information)
Website: http://www.openmw.org Website: http://www.openmw.org