Add Actor.HasReceived

This commit is contained in:
jekyllgrim 2024-01-04 22:15:19 +03:00 committed by Rachael Alexanderson
parent a2a7667442
commit 19435293af
2 changed files with 7 additions and 0 deletions

View file

@ -518,6 +518,11 @@ class Actor : Thinker native
return true;
}
// [AA] Called by inventory items at the end of CallTryPickup to let actors
// do something with the items they've received. 'Item' might be null for
// items that disappear on pickup.
virtual void HasReceived(Inventory item) {}
// Called in TryMove if the mover ran into another Actor. This isn't called on players
// if they're currently predicting. Guarantees collisions unlike CanCollideWith.
virtual void CollidedWith(Actor other, bool passive) {}

View file

@ -645,6 +645,8 @@ class Inventory : Actor
}
}
}
// [AA] Let the toucher do something with the item they've just received:
toucher.HasReceived(self);
}
return res, toucher;
}