Merge remote-tracking branch 'upstream/openmw-36' into HEAD

c++11
scrawl 10 years ago
commit ddc8896dc6

@ -3,6 +3,7 @@
Bug #923: Editor: Operations-Multithreading is broken Bug #923: Editor: Operations-Multithreading is broken
Bug #1317: Erene Llenim in Seyda Neen does not walk around Bug #1317: Erene Llenim in Seyda Neen does not walk around
Bug #1405: Water rendering glitch near Seyda Neen lighthouse
Bug #1621: "Error Detecting Morrowind Installation" in the default directory Bug #1621: "Error Detecting Morrowind Installation" in the default directory
Bug #2216: Creating a clone of the player stops you moving. Bug #2216: Creating a clone of the player stops you moving.
Bug #2387: Casting bound weapon spell doesn't switch to "ready weapon" mode Bug #2387: Casting bound weapon spell doesn't switch to "ready weapon" mode
@ -23,6 +24,10 @@
Bug #2475: cumulative stacks of 100 point fortify skill speechcraft boosts do not apply correctly Bug #2475: cumulative stacks of 100 point fortify skill speechcraft boosts do not apply correctly
Bug #2498: Editor: crash when issuing undo command after the table subview is closed Bug #2498: Editor: crash when issuing undo command after the table subview is closed
Bug #2500: Editor: object table - can't undo delete record Bug #2500: Editor: object table - can't undo delete record
Bug #2518: OpenMW detect spell returns false positives
Bug #2521: NPCs don't react to stealing when inventory menu is open.
Bug #2525: Can't click on red dialogue choice [rise of house telvanni][60fffec]
Bug #2530: GetSpellEffects not working as in vanilla
Feature #139: Editor: Global Search & Replace Feature #139: Editor: Global Search & Replace
Feature #1219: Editor: Add dialogue mode only columns Feature #1219: Editor: Add dialogue mode only columns
Feature #2024: Hotkey for hand to hand (i.e. unequip any weapon) Feature #2024: Hotkey for hand to hand (i.e. unequip any weapon)
@ -34,6 +39,7 @@
Feature #2505: Editor: optionally show a line number column in the script editor Feature #2505: Editor: optionally show a line number column in the script editor
Feature #2512: Editor: Offer use of monospace fonts in the script editor as an option Feature #2512: Editor: Offer use of monospace fonts in the script editor as an option
Feature #2514: Editor: focus on ID input field on clone/add Feature #2514: Editor: focus on ID input field on clone/add
Feature #2519: it is not possible to change icons that appear on the map after casting the Detect <animal | enchantment | key> spells
Task #2460: OS X: Use Application Support directory as user data path Task #2460: OS X: Use Application Support directory as user data path
Task #2516: Editor: Change References / Referenceables terminology Task #2516: Editor: Change References / Referenceables terminology

@ -251,7 +251,7 @@ namespace MWClass
float hitchance = MWMechanics::getHitChance(ptr, victim, ref->mBase->mData.mCombat); float hitchance = MWMechanics::getHitChance(ptr, victim, ref->mBase->mData.mCombat);
if(OEngine::Misc::Rng::rollProbability() >= hitchance/100.0f) if(OEngine::Misc::Rng::roll0to99() >= hitchance)
{ {
victim.getClass().onHit(victim, 0.0f, false, MWWorld::Ptr(), ptr, false); victim.getClass().onHit(victim, 0.0f, false, MWWorld::Ptr(), ptr, false);
MWMechanics::reduceWeaponCondition(0.f, false, weapon, ptr); MWMechanics::reduceWeaponCondition(0.f, false, weapon, ptr);

@ -515,7 +515,7 @@ namespace MWClass
float hitchance = MWMechanics::getHitChance(ptr, victim, ptr.getClass().getSkill(ptr, weapskill)); float hitchance = MWMechanics::getHitChance(ptr, victim, ptr.getClass().getSkill(ptr, weapskill));
if (OEngine::Misc::Rng::rollProbability() >= hitchance / 100.0f) if (OEngine::Misc::Rng::roll0to99() >= hitchance)
{ {
othercls.onHit(victim, 0.0f, false, weapon, ptr, false); othercls.onHit(victim, 0.0f, false, weapon, ptr, false);
MWMechanics::reduceWeaponCondition(0.f, false, weapon, ptr); MWMechanics::reduceWeaponCondition(0.f, false, weapon, ptr);

@ -485,6 +485,12 @@ namespace MWDialogue
executeScript (info->mResultScript); executeScript (info->mResultScript);
} }
else
{
mChoice = -1;
mIsInChoice = false;
MWBase::Environment::get().getWindowManager()->getDialogueWindow()->clearChoices();
}
} }
} }

@ -594,6 +594,8 @@ namespace MWGui
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr(); MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
MWBase::Environment::get().getWorld()->breakInvisibility(player); MWBase::Environment::get().getWorld()->breakInvisibility(player);
MWBase::Environment::get().getMechanicsManager()->itemTaken(player, object, MWWorld::Ptr(), count);
// add to player inventory // add to player inventory
// can't use ActionTake here because we need an MWWorld::Ptr to the newly inserted object // can't use ActionTake here because we need an MWWorld::Ptr to the newly inserted object
MWWorld::Ptr newObject = *player.getClass().getContainerStore (player).add (object, object.getRefData().getCount(), player); MWWorld::Ptr newObject = *player.getClass().getContainerStore (player).add (object, object.getRefData().getCount(), player);
@ -612,8 +614,6 @@ namespace MWGui
throw std::runtime_error("Added item not found"); throw std::runtime_error("Added item not found");
mDragAndDrop->startDrag(i, mSortModel, mTradeModel, mItemView, count); mDragAndDrop->startDrag(i, mSortModel, mTradeModel, mItemView, count);
MWBase::Environment::get().getMechanicsManager()->itemTaken(player, newObject, MWWorld::Ptr(), count);
MWBase::Environment::get().getWindowManager()->updateSpellWindow(); MWBase::Environment::get().getWindowManager()->updateSpellWindow();
} }

@ -300,17 +300,17 @@ namespace MWGui
MarkerUserData markerPos; MarkerUserData markerPos;
MyGUI::IntPoint widgetPos = getMarkerPosition(marker.mWorldX, marker.mWorldY, markerPos); MyGUI::IntPoint widgetPos = getMarkerPosition(marker.mWorldX, marker.mWorldY, markerPos);
MyGUI::IntCoord widgetCoord(widgetPos.left - 4, MyGUI::IntCoord widgetCoord(widgetPos.left - 8,
widgetPos.top - 4, widgetPos.top - 8,
8, 8); 16, 16);
MarkerWidget* markerWidget = mLocalMap->createWidget<MarkerWidget>("MarkerButton", MarkerWidget* markerWidget = mLocalMap->createWidget<MarkerWidget>("CustomMarkerButton",
widgetCoord, MyGUI::Align::Default); widgetCoord, MyGUI::Align::Default);
markerWidget->setDepth(Local_MarkerAboveFogLayer); markerWidget->setDepth(Local_MarkerAboveFogLayer);
markerWidget->setUserString("ToolTipType", "Layout"); markerWidget->setUserString("ToolTipType", "Layout");
markerWidget->setUserString("ToolTipLayout", "TextToolTipOneLine"); markerWidget->setUserString("ToolTipLayout", "TextToolTipOneLine");
markerWidget->setUserString("Caption_TextOneLine", MyGUI::TextIterator::toTagsString(marker.mNote)); markerWidget->setUserString("Caption_TextOneLine", MyGUI::TextIterator::toTagsString(marker.mNote));
markerWidget->setNormalColour(MyGUI::Colour(1.0f, 0.3f, 0.3f)); markerWidget->setNormalColour(MyGUI::Colour(0.6f, 0.6f, 0.6f));
markerWidget->setHoverColour(MyGUI::Colour(1.0f, 0.5f, 0.5f)); markerWidget->setHoverColour(MyGUI::Colour(1.0f, 1.0f, 1.0f));
markerWidget->setUserData(marker); markerWidget->setUserData(marker);
markerWidget->setNeedMouseFocus(true); markerWidget->setNeedMouseFocus(true);
customMarkerCreated(markerWidget); customMarkerCreated(markerWidget);
@ -468,21 +468,17 @@ namespace MWGui
return; return;
std::string markerTexture; std::string markerTexture;
MyGUI::Colour markerColour;
if (type == MWBase::World::Detect_Creature) if (type == MWBase::World::Detect_Creature)
{ {
markerTexture = "textures\\menu_map_dcreature.dds"; markerTexture = "textures\\detect_animal_icon.dds";
markerColour = MyGUI::Colour(1,0,0,1);
} }
if (type == MWBase::World::Detect_Key) if (type == MWBase::World::Detect_Key)
{ {
markerTexture = "textures\\menu_map_dkey.dds"; markerTexture = "textures\\detect_key_icon.dds";
markerColour = MyGUI::Colour(0,1,0,1);
} }
if (type == MWBase::World::Detect_Enchantment) if (type == MWBase::World::Detect_Enchantment)
{ {
markerTexture = "textures\\menu_map_dmagic.dds"; markerTexture = "textures\\detect_enchantment_icon.dds";
markerColour = MyGUI::Colour(0,0,1,1);
} }
int counter = 0; int counter = 0;
@ -499,7 +495,7 @@ namespace MWGui
widgetCoord, MyGUI::Align::Default); widgetCoord, MyGUI::Align::Default);
markerWidget->setDepth(Local_MarkerAboveFogLayer); markerWidget->setDepth(Local_MarkerAboveFogLayer);
markerWidget->setImageTexture(markerTexture); markerWidget->setImageTexture(markerTexture);
markerWidget->setColour(markerColour); markerWidget->setImageCoord(MyGUI::IntCoord(0,0,8,8));
markerWidget->setNeedMouseFocus(false); markerWidget->setNeedMouseFocus(false);
mMagicMarkerWidgets.push_back(markerWidget); mMagicMarkerWidgets.push_back(markerWidget);
} }

@ -20,7 +20,7 @@ namespace MWGui
{ {
for (size_t i = 0; i<mSourceModel->getItemCount(); ++i) for (size_t i = 0; i<mSourceModel->getItemCount(); ++i)
{ {
if (chance <= OEngine::Misc::Rng::roll0to99()) if (OEngine::Misc::Rng::roll0to99() > chance)
mHiddenItems.push_back(mSourceModel->getItem(i)); mHiddenItems.push_back(mSourceModel->getItem(i));
} }
} }

@ -127,13 +127,7 @@ namespace MWGui
bool SpellBuyingWindow::playerHasSpell(const std::string &id) bool SpellBuyingWindow::playerHasSpell(const std::string &id)
{ {
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr(); MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
MWMechanics::Spells& playerSpells = player.getClass().getCreatureStats (player).getSpells(); return player.getClass().getCreatureStats(player).getSpells().hasSpell(id);
for (MWMechanics::Spells::TIterator it = playerSpells.begin(); it != playerSpells.end(); ++it)
{
if (Misc::StringUtils::ciEqual(id, it->first))
return true;
}
return false;
} }
void SpellBuyingWindow::onSpellButtonClick(MyGUI::Widget* _sender) void SpellBuyingWindow::onSpellButtonClick(MyGUI::Widget* _sender)

@ -155,8 +155,9 @@ namespace MWGui
if (!region->mSleepList.empty()) if (!region->mSleepList.empty())
{ {
// figure out if player will be woken while sleeping // figure out if player will be woken while sleeping
int x = OEngine::Misc::Rng::rollDice(hoursToWait);
float fSleepRandMod = world->getStore().get<ESM::GameSetting>().find("fSleepRandMod")->getFloat(); float fSleepRandMod = world->getStore().get<ESM::GameSetting>().find("fSleepRandMod")->getFloat();
if (OEngine::Misc::Rng::rollProbability() > fSleepRandMod) if (x > fSleepRandMod * hoursToWait)
{ {
float fSleepRestMod = world->getStore().get<ESM::GameSetting>().find("fSleepRestMod")->getFloat(); float fSleepRestMod = world->getStore().get<ESM::GameSetting>().find("fSleepRestMod")->getFloat();
mInterruptAt = hoursToWait - int(fSleepRestMod * hoursToWait); mInterruptAt = hoursToWait - int(fSleepRestMod * hoursToWait);

@ -187,7 +187,7 @@ namespace MWMechanics
int skillValue = attacker.getClass().getSkill(attacker, int skillValue = attacker.getClass().getSkill(attacker,
weapon.getClass().getEquipmentSkill(weapon)); weapon.getClass().getEquipmentSkill(weapon));
if (OEngine::Misc::Rng::rollProbability() >= getHitChance(attacker, victim, skillValue) / 100.0f) if (OEngine::Misc::Rng::roll0to99() >= getHitChance(attacker, victim, skillValue))
{ {
victim.getClass().onHit(victim, 0.0f, false, projectile, attacker, false); victim.getClass().onHit(victim, 0.0f, false, projectile, attacker, false);
MWMechanics::reduceWeaponCondition(0.f, false, weapon, attacker); MWMechanics::reduceWeaponCondition(0.f, false, weapon, attacker);

@ -737,7 +737,7 @@ namespace MWMechanics
float x = 0; float x = 0;
float y = 0; float y = 0;
float roll = OEngine::Misc::Rng::rollClosedProbability() * 100; int roll = OEngine::Misc::Rng::roll0to99();
if (type == PT_Admire) if (type == PT_Admire)
{ {

@ -143,6 +143,20 @@ namespace MWMechanics
return mSelectedSpell; return mSelectedSpell;
} }
bool Spells::isSpellActive(const std::string &id) const
{
TContainer::const_iterator found = mSpells.find(id);
if (found != mSpells.end())
{
const ESM::Spell *spell =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (id);
return (spell->mData.mType==ESM::Spell::ST_Ability || spell->mData.mType==ESM::Spell::ST_Blight ||
spell->mData.mType==ESM::Spell::ST_Disease || spell->mData.mType==ESM::Spell::ST_Curse);
}
return false;
}
bool Spells::hasCommonDisease() const bool Spells::hasCommonDisease() const
{ {
for (TIterator iter = mSpells.begin(); iter!=mSpells.end(); ++iter) for (TIterator iter = mSpells.begin(); iter!=mSpells.end(); ++iter)

@ -98,6 +98,9 @@ namespace MWMechanics
const std::string getSelectedSpell() const; const std::string getSelectedSpell() const;
///< May return an empty string. ///< May return an empty string.
bool isSpellActive(const std::string& id) const;
///< Are we under the effects of the given spell ID?
bool hasCommonDisease() const; bool hasCommonDisease() const;
bool hasBlightDisease() const; bool hasBlightDisease() const;

@ -595,7 +595,8 @@ namespace MWScript
std::string id = runtime.getStringLiteral(runtime[0].mInteger); std::string id = runtime.getStringLiteral(runtime[0].mInteger);
runtime.pop(); runtime.pop();
runtime.push(ptr.getClass().getCreatureStats(ptr).getActiveSpells().isSpellActive(id)); const MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr);
runtime.push(stats.getActiveSpells().isSpellActive(id) || stats.getSpells().isSpellActive(id));
} }
}; };

@ -515,14 +515,8 @@ namespace MWScript
Interpreter::Type_Integer value = 0; Interpreter::Type_Integer value = 0;
for (MWMechanics::Spells::TIterator iter ( if (ptr.getClass().getCreatureStats(ptr).getSpells().hasSpell(id))
ptr.getClass().getCreatureStats (ptr).getSpells().begin());
iter!=ptr.getClass().getCreatureStats (ptr).getSpells().end(); ++iter)
if (iter->first==id)
{
value = 1; value = 1;
break;
}
runtime.push (value); runtime.push (value);
} }

@ -120,6 +120,7 @@ namespace MWWorld
/// Call functor (ref) for each reference. functor must return a bool. Returning /// Call functor (ref) for each reference. functor must return a bool. Returning
/// false will abort the iteration. /// false will abort the iteration.
/// \attention This function also lists deleted (count 0) objects!
/// \return Iteration completed? /// \return Iteration completed?
/// ///
/// \note Creatures and NPCs are handled last. /// \note Creatures and NPCs are handled last.

@ -256,12 +256,13 @@ namespace MWWorld
insertCell (*cell, true, loadingListener); insertCell (*cell, true, loadingListener);
mRendering.cellAdded (cell); mRendering.cellAdded (cell);
bool waterEnabled = cell->getCell()->hasWater(); bool waterEnabled = cell->getCell()->hasWater() || cell->isExterior();
mRendering.setWaterEnabled(waterEnabled); mRendering.setWaterEnabled(waterEnabled);
float waterLevel = cell->isExterior() ? -1.f : cell->getWaterLevel();
if (waterEnabled) if (waterEnabled)
{ {
mPhysics->enableWater(cell->getWaterLevel()); mPhysics->enableWater(waterLevel);
mRendering.setWaterHeight(cell->getWaterLevel()); mRendering.setWaterHeight(waterLevel);
} }
else else
mPhysics->disableWater(); mPhysics->disableWater();

@ -2956,7 +2956,7 @@ namespace MWWorld
Ogre::Vector3(mDetector.getRefData().getPosition().pos)) >= mSquaredDist) Ogre::Vector3(mDetector.getRefData().getPosition().pos)) >= mSquaredDist)
return true; return true;
if (!ptr.getRefData().isEnabled()) if (!ptr.getRefData().isEnabled() || ptr.getRefData().isDeleted())
return true; return true;
// Consider references inside containers as well (except if we are looking for a Creature, they cannot be in containers) // Consider references inside containers as well (except if we are looking for a Creature, they cannot be in containers)

@ -31,6 +31,15 @@
</BasisSkin> </BasisSkin>
</Resource> </Resource>
<Resource type="ResourceLayout" name="CustomMarkerButton" version="3.2.0">
<Widget type="Widget" skin="" position="0 0 16 16" name="Root">
<Widget type="ImageBox" skin="ImageBox" position="0 0 16 16" align="Stretch">
<Property key="ImageTexture" value="icons\map_marker_red.dds"/>
<Property key="NeedMouse" value="false"/>
</Widget>
</Widget>
</Resource>
<Resource type="ResourceLayout" name="TabControl" version="3.2.0"> <Resource type="ResourceLayout" name="TabControl" version="3.2.0">
<Widget type="Widget" skin="" position="5 5 89 60" name="Root"> <Widget type="Widget" skin="" position="5 5 89 60" name="Root">
<UserString key="ButtonSkin" value="MW_Button_RightPadding"/> <UserString key="ButtonSkin" value="MW_Button_RightPadding"/>

Loading…
Cancel
Save