- change teleport freeze handling to a player property plus virtual override on PlayerPawn for increased configurability.

This commit is contained in:
Christoph Oelckers 2018-11-24 21:37:00 +01:00
commit b6d0d5008e
4 changed files with 28 additions and 54 deletions

View file

@ -200,55 +200,6 @@ bool AInventory::Grind(bool items)
return Super::Grind(items);
}
//===========================================================================
//
// AInventory :: GetSpeedFactor
//
//===========================================================================
double AInventory::GetSpeedFactor()
{
double factor = 1.;
auto self = this;
while (self != nullptr)
{
IFVIRTUALPTR(self, AInventory, GetSpeedFactor)
{
VMValue params[1] = { (DObject*)self };
double retval;
VMReturn ret(&retval);
VMCall(func, params, 1, &ret, 1);
factor *= retval;
}
self = self->Inventory;
}
return factor;
}
//===========================================================================
//
// AInventory :: GetNoTeleportFreeze
//
//===========================================================================
bool AInventory::GetNoTeleportFreeze ()
{
auto self = this;
while (self != nullptr)
{
IFVIRTUALPTR(self, AInventory, GetNoTeleportFreeze)
{
VMValue params[1] = { (DObject*)self };
int retval;
VMReturn ret(&retval);
VMCall(func, params, 1, &ret, 1);
if (retval) return true;
}
self = self->Inventory;
}
return false;
}
//===========================================================================
//
// AInventory :: Use