mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-22 21:40:42 +00:00
Bring HitAttemptOnMe in line with HitOnMe
This commit is contained in:
parent
51024a8208
commit
1bc24d5120
@ -362,6 +362,11 @@ namespace MWMechanics
|
||||
mLastHitAttemptObject = objectid;
|
||||
}
|
||||
|
||||
void CreatureStats::clearLastHitAttemptObject()
|
||||
{
|
||||
mLastHitAttemptObject.clear();
|
||||
}
|
||||
|
||||
const std::string &CreatureStats::getLastHitAttemptObject() const
|
||||
{
|
||||
return mLastHitAttemptObject;
|
||||
|
@ -258,6 +258,7 @@ namespace MWMechanics
|
||||
void clearLastHitObject();
|
||||
const std::string &getLastHitObject() const;
|
||||
void setLastHitAttemptObject(const std::string &objectid);
|
||||
void clearLastHitAttemptObject();
|
||||
const std::string &getLastHitAttemptObject() const;
|
||||
void setHitAttemptActorId(const int actorId);
|
||||
int getHitAttemptActorId() const;
|
||||
|
@ -997,9 +997,10 @@ namespace MWScript
|
||||
runtime.pop();
|
||||
|
||||
MWMechanics::CreatureStats &stats = ptr.getClass().getCreatureStats(ptr);
|
||||
runtime.push(::Misc::StringUtils::ciEqual(objectID, stats.getLastHitAttemptObject()));
|
||||
|
||||
stats.setLastHitAttemptObject(std::string());
|
||||
bool hit = ::Misc::StringUtils::ciEqual(objectID, stats.getLastHitAttemptObject());
|
||||
runtime.push(hit);
|
||||
if(hit)
|
||||
stats.clearLastHitAttemptObject();
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user