Reimplement reverted commit but with some important safety checks.
This commit is contained in:
parent
7c9869052d
commit
c5e7c0edb8
17 changed files with 139 additions and 228 deletions
|
|
@ -178,14 +178,18 @@ extend Class SWWMHandler
|
|||
// copies the floatbob of overlapping identical items, so it doesn't look weird
|
||||
private void CopyFloatBob( Actor a )
|
||||
{
|
||||
let bt = BlockThingsIterator.Create(a,16);
|
||||
while ( bt.Next() )
|
||||
bool breakout = false;
|
||||
foreach ( s:level.Sectors )
|
||||
{
|
||||
let t = bt.Thing;
|
||||
if ( !t || (t == a) || !(t is 'Inventory') || !(t.spawnpoint ~== a.spawnpoint) ) continue;
|
||||
a.floatbobphase = t.floatbobphase;
|
||||
a.angle = t.angle; // also copy angle
|
||||
break;
|
||||
for ( Actor t=s.thinglist; t; t=t.snext )
|
||||
{
|
||||
if ( (t == a) || !(t is 'Inventory') || !(t.spawnpoint ~== a.spawnpoint) ) continue;
|
||||
a.floatbobphase = t.floatbobphase;
|
||||
a.angle = t.angle; // also copy angle
|
||||
breakout = true;
|
||||
break;
|
||||
}
|
||||
if ( breakout ) break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue