- scriptified AInventory::Tick.
This was the last bit of code standing in the way of making AInventory a fully scripted class. All that's left to sort out is some variable accesses - the vast majority of them in SBARINFO.
This commit is contained in:
parent
d88d173b38
commit
807df33e1a
4 changed files with 41 additions and 43 deletions
|
|
@ -75,48 +75,6 @@ DEFINE_FIELD(AInventory, SpawnPointClass)
|
|||
DEFINE_FIELD(AInventory, PickupFlash)
|
||||
DEFINE_FIELD(AInventory, PickupSound)
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// AInventory :: Tick
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void AInventory::Tick ()
|
||||
{
|
||||
if (Owner == NULL)
|
||||
{
|
||||
// AActor::Tick is only handling interaction with the world
|
||||
// and we don't want that for owned inventory items.
|
||||
Super::Tick ();
|
||||
}
|
||||
else if (tics != -1) // ... but at least we have to advance the states
|
||||
{
|
||||
tics--;
|
||||
|
||||
// you can cycle through multiple states in a tic
|
||||
// [RH] Use <= 0 instead of == 0 so that spawnstates
|
||||
// of 0 tics work as expected.
|
||||
if (tics <= 0)
|
||||
{
|
||||
assert (state != NULL);
|
||||
if (state == NULL)
|
||||
{
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
if (!SetState (state->GetNextState()))
|
||||
return; // freed itself
|
||||
}
|
||||
}
|
||||
if (DropTime)
|
||||
{
|
||||
if (--DropTime == 0)
|
||||
{
|
||||
flags |= GetDefault()->flags & (MF_SPECIAL|MF_SOLID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// AInventory :: Serialize
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue