mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:53:53 +00:00
Merge branch 'getweapondrawn' into 'master'
Make getWeaponDrawn return 1 only when the weapon is attached (bug #4816) Closes #4816 See merge request OpenMW/openmw!2294
This commit is contained in:
commit
98d0b91b6e
5 changed files with 20 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
------
|
------
|
||||||
|
|
||||||
Bug #4127: Weapon animation looks choppy
|
Bug #4127: Weapon animation looks choppy
|
||||||
|
Bug #4816: GetWeaponDrawn returns 1 before weapon is attached
|
||||||
Bug #5057: Weapon swing sound plays at same pitch whether it hits or misses
|
Bug #5057: Weapon swing sound plays at same pitch whether it hits or misses
|
||||||
Bug #5129: Stuttering animation on Centurion Archer
|
Bug #5129: Stuttering animation on Centurion Archer
|
||||||
Bug #5977: Fatigueless NPCs' corpse underwater changes animation on game load
|
Bug #5977: Fatigueless NPCs' corpse underwater changes animation on game load
|
||||||
|
|
|
@ -465,6 +465,7 @@ public:
|
||||||
const osg::Node* getNode(const std::string& name) const;
|
const osg::Node* getNode(const std::string& name) const;
|
||||||
|
|
||||||
virtual bool useShieldAnimations() const { return false; }
|
virtual bool useShieldAnimations() const { return false; }
|
||||||
|
virtual bool getWeaponsShown() const { return false; }
|
||||||
virtual void showWeapons(bool showWeapon) {}
|
virtual void showWeapons(bool showWeapon) {}
|
||||||
virtual bool getCarriedLeftShown() const { return false; }
|
virtual bool getCarriedLeftShown() const { return false; }
|
||||||
virtual void showCarriedLeft(bool show) {}
|
virtual void showCarriedLeft(bool show) {}
|
||||||
|
|
|
@ -30,6 +30,7 @@ namespace MWRender
|
||||||
|
|
||||||
void equipmentChanged() override { updateParts(); }
|
void equipmentChanged() override { updateParts(); }
|
||||||
|
|
||||||
|
bool getWeaponsShown() const override { return mShowWeapons; }
|
||||||
void showWeapons(bool showWeapon) override;
|
void showWeapons(bool showWeapon) override;
|
||||||
|
|
||||||
bool getCarriedLeftShown() const override { return mShowCarriedLeft; }
|
bool getCarriedLeftShown() const override { return mShowCarriedLeft; }
|
||||||
|
|
|
@ -135,6 +135,7 @@ public:
|
||||||
/// to indicate the facing orientation of the character.
|
/// to indicate the facing orientation of the character.
|
||||||
void setPitchFactor(float factor) override { mPitchFactor = factor; }
|
void setPitchFactor(float factor) override { mPitchFactor = factor; }
|
||||||
|
|
||||||
|
bool getWeaponsShown() const override { return mShowWeapons; }
|
||||||
void showWeapons(bool showWeapon) override;
|
void showWeapons(bool showWeapon) override;
|
||||||
|
|
||||||
bool updateCarriedLeftVisible(const int weaptype) const override;
|
bool updateCarriedLeftVisible(const int weaptype) const override;
|
||||||
|
|
|
@ -47,6 +47,8 @@
|
||||||
#include "../mwmechanics/spellcasting.hpp"
|
#include "../mwmechanics/spellcasting.hpp"
|
||||||
#include "../mwmechanics/actorutil.hpp"
|
#include "../mwmechanics/actorutil.hpp"
|
||||||
|
|
||||||
|
#include "../mwrender/animation.hpp"
|
||||||
|
|
||||||
#include "interpretercontext.hpp"
|
#include "interpretercontext.hpp"
|
||||||
#include "ref.hpp"
|
#include "ref.hpp"
|
||||||
|
|
||||||
|
@ -781,9 +783,21 @@ namespace MWScript
|
||||||
void execute (Interpreter::Runtime& runtime) override
|
void execute (Interpreter::Runtime& runtime) override
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
auto& cls = ptr.getClass();
|
||||||
|
if (!cls.hasInventoryStore(ptr) && !cls.isBipedal(ptr))
|
||||||
|
{
|
||||||
|
runtime.push(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
runtime.push((ptr.getClass().hasInventoryStore(ptr) || ptr.getClass().isBipedal(ptr)) &&
|
if (cls.getCreatureStats(ptr).getDrawState () != MWMechanics::DrawState::Weapon)
|
||||||
ptr.getClass().getCreatureStats (ptr).getDrawState () == MWMechanics::DrawState::Weapon);
|
{
|
||||||
|
runtime.push(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MWRender::Animation* anim = MWBase::Environment::get().getWorld()->getAnimation(ptr);
|
||||||
|
runtime.push(anim && anim->getWeaponsShown());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue