mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-23 06:41:08 +00:00
Accept a ConstPtr in getPrimaryFaction, getPrimaryFactionRank
This commit is contained in:
parent
2ac92012e8
commit
2bd8d60e9f
@ -1255,15 +1255,15 @@ namespace MWClass
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Npc::getPrimaryFaction (const MWWorld::Ptr& ptr) const
|
std::string Npc::getPrimaryFaction (const MWWorld::ConstPtr& ptr) const
|
||||||
{
|
{
|
||||||
MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
|
const MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
|
||||||
return ref->mBase->mFaction;
|
return ref->mBase->mFaction;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Npc::getPrimaryFactionRank (const MWWorld::Ptr& ptr) const
|
int Npc::getPrimaryFactionRank (const MWWorld::ConstPtr& ptr) const
|
||||||
{
|
{
|
||||||
MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
|
const MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
|
||||||
return ref->mBase->getFactionRank();
|
return ref->mBase->getFactionRank();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,8 +164,8 @@ namespace MWClass
|
|||||||
|
|
||||||
virtual int getBaseFightRating (const MWWorld::ConstPtr& ptr) const;
|
virtual int getBaseFightRating (const MWWorld::ConstPtr& ptr) const;
|
||||||
|
|
||||||
virtual std::string getPrimaryFaction(const MWWorld::Ptr &ptr) const;
|
virtual std::string getPrimaryFaction(const MWWorld::ConstPtr &ptr) const;
|
||||||
virtual int getPrimaryFactionRank(const MWWorld::Ptr &ptr) const;
|
virtual int getPrimaryFactionRank(const MWWorld::ConstPtr &ptr) const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
std::string getDialogueActorFaction(MWWorld::Ptr actor)
|
std::string getDialogueActorFaction(MWWorld::ConstPtr actor)
|
||||||
{
|
{
|
||||||
std::string factionId = actor.getClass().getPrimaryFaction(actor);
|
std::string factionId = actor.getClass().getPrimaryFaction(actor);
|
||||||
if (factionId.empty())
|
if (factionId.empty())
|
||||||
@ -530,7 +530,7 @@ namespace MWScript
|
|||||||
|
|
||||||
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr actor = R()(runtime, false);
|
MWWorld::ConstPtr actor = R()(runtime, false);
|
||||||
|
|
||||||
std::string factionID = "";
|
std::string factionID = "";
|
||||||
|
|
||||||
@ -562,7 +562,7 @@ namespace MWScript
|
|||||||
|
|
||||||
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr actor = R()(runtime, false);
|
MWWorld::ConstPtr actor = R()(runtime, false);
|
||||||
|
|
||||||
std::string factionID = "";
|
std::string factionID = "";
|
||||||
|
|
||||||
@ -601,7 +601,7 @@ namespace MWScript
|
|||||||
|
|
||||||
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr actor = R()(runtime, false);
|
MWWorld::ConstPtr actor = R()(runtime, false);
|
||||||
|
|
||||||
std::string factionID = "";
|
std::string factionID = "";
|
||||||
|
|
||||||
@ -633,7 +633,7 @@ namespace MWScript
|
|||||||
|
|
||||||
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime, false);
|
MWWorld::ConstPtr ptr = R()(runtime, false);
|
||||||
|
|
||||||
std::string factionID = "";
|
std::string factionID = "";
|
||||||
if(arg0 >0)
|
if(arg0 >0)
|
||||||
@ -739,7 +739,7 @@ namespace MWScript
|
|||||||
|
|
||||||
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime, false);
|
MWWorld::ConstPtr ptr = R()(runtime, false);
|
||||||
|
|
||||||
std::string factionId;
|
std::string factionId;
|
||||||
|
|
||||||
@ -771,7 +771,7 @@ namespace MWScript
|
|||||||
|
|
||||||
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime, false);
|
MWWorld::ConstPtr ptr = R()(runtime, false);
|
||||||
|
|
||||||
Interpreter::Type_Integer value = runtime[0].mInteger;
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
@ -805,7 +805,7 @@ namespace MWScript
|
|||||||
|
|
||||||
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime, false);
|
MWWorld::ConstPtr ptr = R()(runtime, false);
|
||||||
|
|
||||||
Interpreter::Type_Integer value = runtime[0].mInteger;
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
@ -867,7 +867,7 @@ namespace MWScript
|
|||||||
|
|
||||||
virtual void execute (Interpreter::Runtime& runtime)
|
virtual void execute (Interpreter::Runtime& runtime)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::ConstPtr ptr = R()(runtime);
|
||||||
|
|
||||||
std::string race = runtime.getStringLiteral(runtime[0].mInteger);
|
std::string race = runtime.getStringLiteral(runtime[0].mInteger);
|
||||||
::Misc::StringUtils::lowerCaseInPlace(race);
|
::Misc::StringUtils::lowerCaseInPlace(race);
|
||||||
@ -899,7 +899,7 @@ namespace MWScript
|
|||||||
|
|
||||||
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime, false);
|
MWWorld::ConstPtr ptr = R()(runtime, false);
|
||||||
|
|
||||||
std::string factionID = "";
|
std::string factionID = "";
|
||||||
if(arg0 >0 )
|
if(arg0 >0 )
|
||||||
@ -931,7 +931,7 @@ namespace MWScript
|
|||||||
|
|
||||||
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime, false);
|
MWWorld::ConstPtr ptr = R()(runtime, false);
|
||||||
|
|
||||||
std::string factionID = "";
|
std::string factionID = "";
|
||||||
if(arg0 >0 )
|
if(arg0 >0 )
|
||||||
@ -958,7 +958,7 @@ namespace MWScript
|
|||||||
|
|
||||||
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime, false);
|
MWWorld::ConstPtr ptr = R()(runtime, false);
|
||||||
|
|
||||||
std::string factionID = "";
|
std::string factionID = "";
|
||||||
if(arg0 >0 )
|
if(arg0 >0 )
|
||||||
|
@ -438,11 +438,11 @@ namespace MWWorld
|
|||||||
throw std::runtime_error("class does not support fight rating");
|
throw std::runtime_error("class does not support fight rating");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Class::getPrimaryFaction (const MWWorld::Ptr& ptr) const
|
std::string Class::getPrimaryFaction (const MWWorld::ConstPtr& ptr) const
|
||||||
{
|
{
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
int Class::getPrimaryFactionRank (const MWWorld::Ptr& ptr) const
|
int Class::getPrimaryFactionRank (const MWWorld::ConstPtr& ptr) const
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -338,8 +338,8 @@ namespace MWWorld
|
|||||||
|
|
||||||
virtual int getBaseFightRating (const MWWorld::ConstPtr& ptr) const;
|
virtual int getBaseFightRating (const MWWorld::ConstPtr& ptr) const;
|
||||||
|
|
||||||
virtual std::string getPrimaryFaction (const MWWorld::Ptr& ptr) const;
|
virtual std::string getPrimaryFaction (const MWWorld::ConstPtr& ptr) const;
|
||||||
virtual int getPrimaryFactionRank (const MWWorld::Ptr& ptr) const;
|
virtual int getPrimaryFactionRank (const MWWorld::ConstPtr& ptr) const;
|
||||||
|
|
||||||
/// Get the effective armor rating, factoring in the actor's skills, for the given armor.
|
/// Get the effective armor rating, factoring in the actor's skills, for the given armor.
|
||||||
virtual int getEffectiveArmorRating(const MWWorld::ConstPtr& armor, const MWWorld::Ptr& actor) const;
|
virtual int getEffectiveArmorRating(const MWWorld::ConstPtr& armor, const MWWorld::Ptr& actor) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user