Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void client_DoFloor( BYTESTREAM_s *pByteStream )
- {
- LONG lType;
- LONG lDirection;
- LONG FloorDestDist;
- LONG lSpeed;
- LONG lSectorID;
- LONG lFloorID;
- sector_t *pSector;
- DFloor *pFloor;
- // Read in the type of floor.
- lType = NETWORK_ReadByte( pByteStream );
- // Read in the sector ID.
- lSectorID = NETWORK_ReadShort( pByteStream );
- // Read in the direction of the floor.
- lDirection = NETWORK_ReadByte( pByteStream );
- // Read in the speed of the floor.
- lSpeed = NETWORK_ReadLong( pByteStream );
- // Read in the floor's destination height.
- FloorDestDist = NETWORK_ReadLong( pByteStream );
- // Read in the floor's network ID.
- lFloorID = NETWORK_ReadShort( pByteStream );
- // Since we still want to receive direction as a byte, but -1 can't be represented in byte
- // form, adjust the value into something that can be represented.
- lDirection = CLIENT_AdjustFloorDirection( lDirection );
- if ( lDirection == INT_MAX )
- return;
- // Invalid sector.
- if (( lSectorID >= numsectors ) || ( lSectorID < 0 ))
- return;
- pSector = §ors[lSectorID];
- // If the sector already has activity, don't override it.
- if ( pSector->floordata )
- return;
- pFloor = new DFloor( pSector );
- pFloor->SetType( (DFloor::EFloor)lType );
- pFloor->SetDirection( lDirection );
- pFloor->SetFloorDestDist( FloorDestDist );
- pFloor->SetSpeed( lSpeed );
- pFloor->SetID( lFloorID );
- }
Add Comment
Please, Sign In to add comment