From dfdd2dc3086e28fb65e29a77923c8e3007a2bc35 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 8 Aug 2013 01:35:22 -0700 Subject: [PATCH] Handle swimleft and swimright soundgen keys --- apps/openmw/mwclass/creature.cpp | 4 ++++ apps/openmw/mwclass/npc.cpp | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index 911d049d2..281d7fa98 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -420,6 +420,10 @@ namespace MWClass return 1; return -1; } + if(name == "swimleft") + return 2; + if(name == "swimright") + return 3; if(name == "moan") return 4; if(name == "roar") diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 29302768c..0db99417d 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -940,6 +940,8 @@ namespace MWClass { MWBase::World *world = MWBase::Environment::get().getWorld(); Ogre::Vector3 pos(ptr.getRefData().getPosition().pos); + if(world->isSwimming(ptr)) + return "Swim Left"; if(world->isUnderwater(ptr.getCell(), pos)) return "FootWaterLeft"; if(world->isOnGround(ptr)) @@ -965,6 +967,8 @@ namespace MWClass { MWBase::World *world = MWBase::Environment::get().getWorld(); Ogre::Vector3 pos(ptr.getRefData().getPosition().pos); + if(world->isSwimming(ptr)) + return "Swim Right"; if(world->isUnderwater(ptr.getCell(), pos)) return "FootWaterRight"; if(world->isOnGround(ptr)) @@ -986,6 +990,10 @@ namespace MWClass } return ""; } + if(name == "swimleft") + return "Swim Left"; + if(name == "swimright") + return "Swim Right"; // TODO: I have no idea what these are supposed to do for NPCs since they use // voiced dialog for various conditions like health loss and combat taunts. Maybe // only for biped creatures?