Code: Select all
function EndState()
{
bCollideWorld = false;
bSleepTouch = false;
}
Code: Select all
function EndState()
{
if (Physics != PHYS_Falling)
bCollideWorld = false;
bSleepTouch = false;
}
When a weapon is dropped by a player, Inventory.DropFrom is called:
Code: Select all
function DropFrom(vector StartLocation)
{
if ( !SetLocation(StartLocation) )
return;
RespawnTime = 0.0; //don't respawn
SetPhysics(PHYS_Falling);
RemoteRole = ROLE_DumbProxy;
BecomePickup();
NetPriority = 6;
bCollideWorld = true;
if ( Pawn(Owner) != None )
Pawn(Owner).DeleteInventory(self);
GotoState('PickUp', 'Dropped');
}
Code: Select all
function Timer()
{
if ( RemoteRole != ROLE_SimulatedProxy )
{
NetPriority = 2;
RemoteRole = ROLE_SimulatedProxy;
if ( bHeldItem )
SetTimer(40.0, false);
return;
}
if ( bHeldItem )
Destroy();
}
Code: Select all
function Landed(Vector HitNormal)
{
local rotator newRot;
newRot = Rotation;
newRot.pitch = 0;
SetRotation(newRot);
SetTimer(2.0, false);
}
Theoretically, such a situation may also occur when the weapon has bHeldItem == true and it falls during more than 45 seconds. This is how I would fix the current implementation:
Code: Select all
function Timer()
{
if ( RemoteRole != ROLE_SimulatedProxy )
{
NetPriority = 2;
RemoteRole = ROLE_SimulatedProxy;
+ if (Physics == PHYS_Falling)
+ bSimulatedPawnRep = true;
if ( bHeldItem )
SetTimer(40.0, false);
return;
}
if ( bHeldItem )
Destroy();
}
function BeginState()
{
BecomePickup();
bCollideWorld = true;
if ( bHeldItem )
SetTimer(45, false);
+ else
+ SetTimer(0, false);
}
Code: Select all
if (Physics == PHYS_Falling)
bSimulatedPawnRep = true;
Engine/Classes/Inventory.uc