Merge pull request #661 from DreamWeave-MP/dw-fixes

Misc Downstream Fixes
master
David Cernat 1 year ago committed by GitHub
commit 25026c0a2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1860,24 +1860,19 @@ namespace MWMechanics
MWWorld::Ptr player = getPlayer(); MWWorld::Ptr player = getPlayer();
const osg::Vec3f playerPos = player.getRefData().getPosition().asVec3(); const osg::Vec3f playerPos = player.getRefData().getPosition().asVec3();
bool hasHostiles = false; // need to know this to play Battle music bool hasHostiles = false; // need to know this to play Battle music
bool aiActive = MWBase::Environment::get().getMechanicsManager()->isAIActive();
if (aiActive) for(PtrActorMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter)
{ {
for(PtrActorMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter) if (iter->first == player) continue;
{
if (iter->first == player) continue;
bool inProcessingRange = (playerPos - iter->first.getRefData().getPosition().asVec3()).length2() <= mActorsProcessingRange*mActorsProcessingRange; bool inProcessingRange = (playerPos - iter->first.getRefData().getPosition().asVec3()).length2() <= mActorsProcessingRange*mActorsProcessingRange;
if (inProcessingRange) if (!inProcessingRange) continue;
{
MWMechanics::CreatureStats& stats = iter->first.getClass().getCreatureStats(iter->first); MWMechanics::CreatureStats& stats = iter->first.getClass().getCreatureStats(iter->first);
if (!stats.isDead() && stats.getAiSequence().isInCombat()) if (!stats.isDead() && stats.getAiSequence().isInCombat())
{ {
hasHostiles = true; hasHostiles = true;
break; break;
}
}
} }
} }

@ -72,8 +72,8 @@ namespace mwmp
void GUIChat::acceptCommand(MyGUI::EditBox *_sender) void GUIChat::acceptCommand(MyGUI::EditBox *_sender)
{ {
const std::string &cm = MyGUI::TextIterator::toTagsString(mCommandLine->getCaption()); const std::string &cm = mCommandLine->getOnlyText();
// If they enter nothing, then it should be canceled. // If they enter nothing, then it should be canceled.
// Otherwise, there's no way of closing without having text. // Otherwise, there's no way of closing without having text.
if (cm.empty()) if (cm.empty())
@ -97,7 +97,7 @@ namespace mwmp
// during the actual command execution // during the actual command execution
mCommandLine->setCaption(""); mCommandLine->setCaption("");
setEditState(false); setEditState(false);
send (cm); send(cm);
} }
void GUIChat::onResChange(int width, int height) void GUIChat::onResChange(int width, int height)

@ -783,7 +783,7 @@ void ObjectList::rotateObjects(MWWorld::CellStore* cellStore)
ptrFound.getCellRef().getRefNum(), ptrFound.getCellRef().getMpNum()); ptrFound.getCellRef().getRefNum(), ptrFound.getCellRef().getMpNum());
MWBase::Environment::get().getWorld()->rotateObject(ptrFound, MWBase::Environment::get().getWorld()->rotateObject(ptrFound,
baseObject.position.rot[0], baseObject.position.rot[1], baseObject.position.rot[2]); baseObject.position.rot[0], baseObject.position.rot[1], baseObject.position.rot[2], MWBase::RotationFlag_none);
} }
} }
} }

Loading…
Cancel
Save