Fix pet aggro

This commit is contained in:
James Melkonian 2022-09-14 19:48:34 +00:00 committed by Ben Wallis
parent 725fd09ed7
commit 5d5cb28b59
3 changed files with 5 additions and 3 deletions

View File

@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
new chunk for the initial setting or subsequent change to apply). new chunk for the initial setting or subsequent change to apply).
- Moderators and admins are no longer blocked from logging in when there are too many players. - Moderators and admins are no longer blocked from logging in when there are too many players.
- FXAA now behaves correctly at non-1.0x internal resolutions - FXAA now behaves correctly at non-1.0x internal resolutions
- Pets no longer aggro on pet owners after being healed
## [0.13.0] - 2022-07-23 ## [0.13.0] - 2022-07-23

View File

@ -825,8 +825,8 @@ impl<'a> AgentData<'a> {
let wants_pickup = matches!(self.body, Some(Body::Humanoid(_))) let wants_pickup = matches!(self.body, Some(Body::Humanoid(_)))
|| matches!(item, item_drop::Body::Consumable); || matches!(item, item_drop::Body::Consumable);
// The agent will attempt to pickup the item if it wants to pick it up and is // The agent will attempt to pickup the item if it wants to pick it up and
// allowed to // is allowed to
let attempt_pickup = wants_pickup let attempt_pickup = wants_pickup
&& read_data && read_data
.loot_owners .loot_owners

View File

@ -201,7 +201,8 @@ fn react_if_on_fire(bdata: &mut BehaviorData) -> bool {
fn target_if_attacked(bdata: &mut BehaviorData) -> bool { fn target_if_attacked(bdata: &mut BehaviorData) -> bool {
match bdata.agent_data.health { match bdata.agent_data.health {
Some(health) Some(health)
if bdata.read_data.time.0 - health.last_change.time.0 < DAMAGE_MEMORY_DURATION => if bdata.read_data.time.0 - health.last_change.time.0 < DAMAGE_MEMORY_DURATION
&& health.last_change.amount < 0.0 =>
{ {
if let Some(by) = health.last_change.damage_by() { if let Some(by) = health.last_change.damage_by() {
if let Some(attacker) = bdata if let Some(attacker) = bdata