From df5cbe5dec98b1c14cd4aa8916d692b40c5b18f1 Mon Sep 17 00:00:00 2001 From: Jeffrey Haines Date: Fri, 4 Apr 2014 08:10:35 -0400 Subject: [PATCH] Minor changes --- apps/openmw/mwmechanics/actors.cpp | 1 + apps/openmw/mwmechanics/creaturestats.cpp | 3 ++- apps/openmw/mwmechanics/mechanicsmanagerimp.cpp | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index 56f24a747..fcec5a3fb 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -750,6 +750,7 @@ namespace MWMechanics { creatureStats.setAlarmed(false); creatureStats.setHostile(false); + creatureStats.setAttacked(false); if (ptr.getClass().isClass(ptr, "Guard")) creatureStats.getAiSequence().stopPersue(); creatureStats.getAiSequence().stopCombat(); diff --git a/apps/openmw/mwmechanics/creaturestats.cpp b/apps/openmw/mwmechanics/creaturestats.cpp index feed8d182..f81613ed1 100644 --- a/apps/openmw/mwmechanics/creaturestats.cpp +++ b/apps/openmw/mwmechanics/creaturestats.cpp @@ -435,8 +435,9 @@ namespace MWMechanics return getMovementFlag (Flag_Run) || getMovementFlag (Flag_ForceRun); case Stance_Sneak: return getMovementFlag (Flag_Sneak) || getMovementFlag (Flag_ForceSneak); + default: + return false; } - return false; // shut up, compiler } DrawState_ CreatureStats::getDrawState() const diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index 9119b3ab6..8d546b598 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -840,7 +840,8 @@ namespace MWMechanics CreatureStats& creatureStats = MWWorld::Class::get(*it).getCreatureStats(*it); // Was the crime seen? - if ( MWBase::Environment::get().getWorld()->getLOS(ptr, *it) && awarenessCheck(ptr, *it) ) + if ( ( MWBase::Environment::get().getWorld()->getLOS(ptr, *it) && awarenessCheck(ptr, *it) ) || + type == OT_Assault ) { // Say something! // TODO: Add more messages @@ -860,7 +861,8 @@ namespace MWMechanics // Will the witness be affected by the crime? CreatureStats& creatureStats1 = MWWorld::Class::get(*it1).getCreatureStats(*it1); - if (creatureStats1.getAiSetting(CreatureStats::AI_Alarm).getBase() >= alarm) + if (creatureStats1.getAiSetting(CreatureStats::AI_Alarm).getBase() >= alarm || + type == OT_Assault) creatureStats1.setAlarmed(true); } break; // Someone saw the crime and everyone has been told