Initial 1.1 development setup.
This commit is contained in:
parent
685b7d6f91
commit
dc4bd4d45d
144 changed files with 2487 additions and 165 deletions
|
|
@ -723,13 +723,31 @@ Class ChanceboxSpawner : Actor
|
|||
return;
|
||||
}
|
||||
int numbox = 0;
|
||||
let ti = ThinkerIterator.Create("ChanceboxSpawner");
|
||||
ThinkerIterator ti = ThinkerIterator.Create("Chancebox");
|
||||
while ( ti.Next() ) numbox++;
|
||||
ti = ThinkerIterator.Create("Chancebox");
|
||||
while ( ti.Next() ) numbox++;
|
||||
if ( numbox > 3 )
|
||||
if ( numbox >= 3 )
|
||||
{
|
||||
// there's three boxes in the map already (plus ourselves)
|
||||
// there's three boxes in the map already
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
BlockLinesIterator bl = BlockLinesIterator.CreateFromPos(pos,32,32,CurSector);
|
||||
double tbox[4];
|
||||
// top, bottom, left, right
|
||||
tbox[0] = pos.y+32;
|
||||
tbox[1] = pos.y-32;
|
||||
tbox[2] = pos.x-32;
|
||||
tbox[3] = pos.x+32;
|
||||
while ( bl.Next() )
|
||||
{
|
||||
Line l = bl.CurLine;
|
||||
if ( !l ) continue;
|
||||
if ( tbox[2] > l.bbox[3] ) continue;
|
||||
if ( tbox[3] < l.bbox[2] ) continue;
|
||||
if ( tbox[0] < l.bbox[1] ) continue;
|
||||
if ( tbox[1] > l.bbox[0] ) continue;
|
||||
if ( SWWMUtility.BoxOnLineSide(tbox[0],tbox[1],tbox[2],tbox[3],l) != -1 ) continue;
|
||||
// there isn't enough space to spawn a box here
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue