mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-02 01:06:42 +00:00
[Client] Reset friendly hits when summoning a creature
This commit is contained in:
parent
9792a5256f
commit
eeb3e4f938
3 changed files with 25 additions and 0 deletions
|
@ -357,6 +357,19 @@ namespace MWMechanics
|
||||||
return mFriendlyHits;
|
return mFriendlyHits;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Make it possible to set the number of friendly hits from elsewhere
|
||||||
|
*/
|
||||||
|
void CreatureStats::setFriendlyHits(int hits)
|
||||||
|
{
|
||||||
|
mFriendlyHits = hits;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
|
|
||||||
void CreatureStats::friendlyHit()
|
void CreatureStats::friendlyHit()
|
||||||
{
|
{
|
||||||
++mFriendlyHits;
|
++mFriendlyHits;
|
||||||
|
|
|
@ -212,6 +212,16 @@ namespace MWMechanics
|
||||||
int getFriendlyHits() const;
|
int getFriendlyHits() const;
|
||||||
///< Number of friendly hits received.
|
///< Number of friendly hits received.
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Make it possible to set the number of friendly hits from elsewhere
|
||||||
|
*/
|
||||||
|
void setFriendlyHits(int hits);
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
|
|
||||||
void friendlyHit();
|
void friendlyHit();
|
||||||
///< Increase number of friendly hits by one.
|
///< Increase number of friendly hits by one.
|
||||||
|
|
||||||
|
|
|
@ -477,6 +477,8 @@ void ObjectList::spawnObjects(MWWorld::CellStore* cellStore)
|
||||||
// If not, add it to the summoned creature map
|
// If not, add it to the summoned creature map
|
||||||
else
|
else
|
||||||
creatureMap.insert(std::make_pair(std::make_pair(baseObject.summonEffectId, baseObject.summonSpellId), creatureActorId));
|
creatureMap.insert(std::make_pair(std::make_pair(baseObject.summonEffectId, baseObject.summonSpellId), creatureActorId));
|
||||||
|
|
||||||
|
creatureStats.setFriendlyHits(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue