mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 02:06:43 +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;
|
||||
}
|
||||
|
||||
/*
|
||||
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()
|
||||
{
|
||||
++mFriendlyHits;
|
||||
|
|
|
@ -212,6 +212,16 @@ namespace MWMechanics
|
|||
int getFriendlyHits() const;
|
||||
///< 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();
|
||||
///< 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
|
||||
else
|
||||
creatureMap.insert(std::make_pair(std::make_pair(baseObject.summonEffectId, baseObject.summonSpellId), creatureActorId));
|
||||
|
||||
creatureStats.setFriendlyHits(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue