Adds OnDrop virtual to inventory items. Called on the dropped item at the end of AActor::DropInventory.

This commit is contained in:
Mari the Deer 2018-09-16 15:05:57 +02:00 committed by Christoph Oelckers
commit 38c8f0d585
2 changed files with 19 additions and 1 deletions

View file

@ -1158,6 +1158,14 @@ AInventory *AActor::DropInventory (AInventory *item, int amt)
drop->Vel += Vel;
drop->flags &= ~MF_NOGRAVITY; // Don't float
drop->ClearCounters(); // do not count for statistics again
{
// [MK] call OnDrop so item can change its drop behaviour
IFVIRTUALPTR(drop, AInventory, OnDrop)
{
VMValue params[] = { drop, this };
VMCall(func, params, 2, nullptr, 0);
}
}
return drop;
}