|
|
|
@ -50,8 +50,7 @@ void cbClientPosition( CMessage& msgin, const string &serviceName, NLNET::TServi
|
|
|
|
|
H_AUTO(cbClientPosition);
|
|
|
|
|
|
|
|
|
|
CEntityId id;
|
|
|
|
|
NLMISC::TGameCycle fsTick;
|
|
|
|
|
msgin.serial(id, fsTick);
|
|
|
|
|
msgin.serial(id);
|
|
|
|
|
|
|
|
|
|
TDataSetRow entityIndex = TheDataset.getDataSetRow( id );
|
|
|
|
|
if ( !entityIndex.isValid() )
|
|
|
|
@ -62,16 +61,16 @@ void cbClientPosition( CMessage& msgin, const string &serviceName, NLNET::TServi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// entity pos (x, y, z, theta)
|
|
|
|
|
NLMISC::TGameCycle clientTick;
|
|
|
|
|
NLMISC::TGameCycle tick;
|
|
|
|
|
sint32 x, y, z;
|
|
|
|
|
float heading;
|
|
|
|
|
msgin.serial(clientTick, x, y, z, heading);
|
|
|
|
|
msgin.serial(tick, x, y, z, heading);
|
|
|
|
|
|
|
|
|
|
if (IsRingShard)
|
|
|
|
|
{
|
|
|
|
|
// make sure the move that the player is trying to make is legal
|
|
|
|
|
// if the move wasn't legal then the values of 'x' and 'y' will be changed to make them legal
|
|
|
|
|
bool moveWasLegal= pCGPMS->MoveChecker->checkMove(entityIndex, x, y, clientTick);
|
|
|
|
|
bool moveWasLegal= pCGPMS->MoveChecker->checkMove(entityIndex, x, y, tick);
|
|
|
|
|
|
|
|
|
|
// if the move wasn't legal then dispatch a message to the player
|
|
|
|
|
if (!moveWasLegal)
|
|
|
|
@ -103,7 +102,7 @@ void cbClientPosition( CMessage& msgin, const string &serviceName, NLNET::TServi
|
|
|
|
|
CMirrorPropValue1DS<sint32>( TheDataset, entityIndex, DSPropertyPOSY )= y;
|
|
|
|
|
CMirrorPropValue1DS<sint32>( TheDataset, entityIndex, DSPropertyPOSZ )= (z&~7) + (local ? 1 : 0) + (interior ? 2 : 0) + (water ? 4 : 0);
|
|
|
|
|
CMirrorPropValue1DS<float>( TheDataset, entityIndex, DSPropertyORIENTATION )= heading;
|
|
|
|
|
CMirrorPropValue1DS<NLMISC::TGameCycle>( TheDataset, entityIndex, DSPropertyTICK_POS )= clientTick + GPMS_LCT_TICKS;
|
|
|
|
|
CMirrorPropValue1DS<NLMISC::TGameCycle>( TheDataset, entityIndex, DSPropertyTICK_POS )= tick + GPMS_LCT_TICKS;
|
|
|
|
|
|
|
|
|
|
CMirrorPropValue1DS<TYPE_CELL> cell ( TheDataset, entityIndex, DSPropertyCELL );
|
|
|
|
|
uint32 cx = (uint16) ( + x/CWorldPositionManager::getCellSize() );
|
|
|
|
@ -144,7 +143,7 @@ void cbClientPosition( CMessage& msgin, const string &serviceName, NLNET::TServi
|
|
|
|
|
//CWorldPositionManager::setEntityPosition(id, x, y, z, heading, tick);
|
|
|
|
|
if (player->getType() == CWorldEntity::Player && player->CheckMotion && player->PosInitialised)
|
|
|
|
|
{
|
|
|
|
|
CWorldPositionManager::movePlayer(player, x, y, z, heading, clientTick);
|
|
|
|
|
CWorldPositionManager::movePlayer(player, x, y, z, heading, tick);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} // cbClientPosition //
|
|
|
|
|