Merge remote-tracking branch 'scrawl/master'

This commit is contained in:
Marc Zinnschlag 2013-11-17 13:39:04 +01:00
commit d32fcb99b5
8 changed files with 21 additions and 12 deletions

View file

@ -248,7 +248,7 @@ int main(int argc, char**argv)
{ {
#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE #if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE
// Unix crash catcher // Unix crash catcher
if (!is_debugger_attached()) if ((argc == 2 && strcmp(argv[1], "--cc-handle-crash") == 0) || !is_debugger_attached())
{ {
int s[5] = { SIGSEGV, SIGILL, SIGFPE, SIGBUS, SIGABRT }; int s[5] = { SIGSEGV, SIGILL, SIGFPE, SIGBUS, SIGABRT };
cc_install_handlers(argc, argv, 5, s, "crash.log", NULL); cc_install_handlers(argc, argv, 5, s, "crash.log", NULL);

View file

@ -86,12 +86,13 @@ void CompanionWindow::onBackgroundSelected()
void CompanionWindow::open(const MWWorld::Ptr& npc) void CompanionWindow::open(const MWWorld::Ptr& npc)
{ {
mPtr = npc; mPtr = npc;
setTitle(MWWorld::Class::get(npc).getName(npc));
updateEncumbranceBar(); updateEncumbranceBar();
mModel = new CompanionItemModel(npc); mModel = new CompanionItemModel(npc);
mSortModel = new SortFilterItemModel(mModel); mSortModel = new SortFilterItemModel(mModel);
mItemView->setModel(mSortModel); mItemView->setModel(mSortModel);
setTitle(MWWorld::Class::get(npc).getName(npc));
} }
void CompanionWindow::onFrame() void CompanionWindow::onFrame()

View file

@ -220,11 +220,13 @@ namespace MWGui
mDisposeCorpseButton->setVisible(loot); mDisposeCorpseButton->setVisible(loot);
setTitle(MWWorld::Class::get(container).getName(container));
mSortModel = new SortFilterItemModel(mModel); mSortModel = new SortFilterItemModel(mModel);
mItemView->setModel (mSortModel); mItemView->setModel (mSortModel);
// Careful here. setTitle may cause size updates, causing itemview redraw, so make sure to do it last
// or we end up using a possibly invalid model.
setTitle(MWWorld::Class::get(container).getName(container));
} }
void ContainerWindow::onCloseButtonClicked(MyGUI::Widget* _sender) void ContainerWindow::onCloseButtonClicked(MyGUI::Widget* _sender)

View file

@ -82,7 +82,6 @@ namespace MWGui
void TradeWindow::startTrade(const MWWorld::Ptr& actor) void TradeWindow::startTrade(const MWWorld::Ptr& actor)
{ {
mPtr = actor; mPtr = actor;
setTitle(MWWorld::Class::get(actor).getName(actor));
mCurrentBalance = 0; mCurrentBalance = 0;
mCurrentMerchantOffer = 0; mCurrentMerchantOffer = 0;
@ -99,6 +98,10 @@ namespace MWGui
mItemView->setModel (mSortModel); mItemView->setModel (mSortModel);
updateLabels(); updateLabels();
// Careful here. setTitle may cause size updates, causing itemview redraw, so make sure to do it last
// or we end up using a possibly invalid model.
setTitle(MWWorld::Class::get(actor).getName(actor));
} }
void TradeWindow::onFilterChanged(MyGUI::Widget* _sender) void TradeWindow::onFilterChanged(MyGUI::Widget* _sender)

View file

@ -24,8 +24,6 @@ namespace MWMechanics
int mId; int mId;
int mArg; // skill or ability int mArg; // skill or ability
// TODO: Add caster here for Absorb effects?
EffectKey(); EffectKey();
EffectKey (int id, int arg = -1) : mId (id), mArg (arg) {} EffectKey (int id, int arg = -1) : mId (id), mArg (arg) {}

View file

@ -1045,7 +1045,9 @@ void Animation::updateEffects(float duration)
NifOgre::ObjectList& objects = it->mObjects; NifOgre::ObjectList& objects = it->mObjects;
for(size_t i = 0; i < objects.mControllers.size() ;i++) for(size_t i = 0; i < objects.mControllers.size() ;i++)
{ {
static_cast<EffectAnimationValue*> (objects.mControllers[i].getSource().get())->addTime(duration); EffectAnimationValue* value = dynamic_cast<EffectAnimationValue*>(objects.mControllers[i].getSource().get());
if (value)
value->addTime(duration);
objects.mControllers[i].update(); objects.mControllers[i].update();
} }
@ -1058,7 +1060,9 @@ void Animation::updateEffects(float duration)
float remainder = objects.mControllers[0].getSource()->getValue() - objects.mMaxControllerLength; float remainder = objects.mControllers[0].getSource()->getValue() - objects.mMaxControllerLength;
for(size_t i = 0; i < objects.mControllers.size() ;i++) for(size_t i = 0; i < objects.mControllers.size() ;i++)
{ {
static_cast<EffectAnimationValue*> (objects.mControllers[i].getSource().get())->resetTime(remainder); EffectAnimationValue* value = dynamic_cast<EffectAnimationValue*>(objects.mControllers[i].getSource().get());
if (value)
value->resetTime(remainder);
} }
} }
else else

View file

@ -2166,7 +2166,10 @@ namespace MWWorld
if (!contact.first.isEmpty()) if (!contact.first.isEmpty())
{ {
if (contact.first.getClass().isActor()) if (contact.first.getClass().isActor())
{
if (!contact.first.getClass().getCreatureStats(contact.first).isDead())
contact.first.getClass().getCreatureStats(contact.first).getActiveSpells().addSpell(selectedSpell, contact.first, actor, ESM::RT_Touch, sourceName); contact.first.getClass().getCreatureStats(contact.first).getActiveSpells().addSpell(selectedSpell, contact.first, actor, ESM::RT_Touch, sourceName);
}
else else
{ {
// We hit a non-actor, e.g. a door. Only instant effects are relevant. // We hit a non-actor, e.g. a door. Only instant effects are relevant.

View file

@ -132,8 +132,6 @@ short MagicEffect::getResistanceEffect(short effect)
short MagicEffect::getWeaknessEffect(short effect) short MagicEffect::getWeaknessEffect(short effect)
{ {
std::map<short, short> effects; std::map<short, short> effects;
effects[DisintegrateArmor] = Sanctuary;
effects[DisintegrateWeapon] = Sanctuary;
for (int i=0; i<5; ++i) for (int i=0; i<5; ++i)
effects[DrainAttribute+i] = WeaknessToMagicka; effects[DrainAttribute+i] = WeaknessToMagicka;