本文整理汇总了C++中P_PLAYER::goldSound方法的典型用法代码示例。如果您正苦于以下问题:C++ P_PLAYER::goldSound方法的具体用法?C++ P_PLAYER::goldSound怎么用?C++ P_PLAYER::goldSound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类P_PLAYER
的用法示例。
在下文中一共展示了P_PLAYER::goldSound方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dropItem
void DragAndDrop::dropItem( cUOSocket* socket, cUORxDropItem* packet )
{
P_PLAYER pChar = socket->player();
if ( !pChar )
return;
// Get the data
//SERIAL contId = packet->cont();
Coord_cl dropPos = pChar->pos(); // plane
dropPos.x = packet->x();
dropPos.y = packet->y();
dropPos.z = packet->z();
// Get possible containers
P_ITEM pItem = FindItemBySerial( packet->serial() );
if ( !pItem )
return;
P_ITEM iCont = FindItemBySerial( packet->cont() );
P_CHAR cCont = FindCharBySerial( packet->cont() );
// A completely invalid Drop packet
if ( !iCont && !cCont && ( dropPos.x == 0xFFFF ) && ( dropPos.y == 0xFFFF ) )
{
socket->bounceItem( pItem, BR_NO_REASON );
return;
}
float weight = pChar->weight();
// Item dropped on Ground
if ( !iCont && !cCont )
dropOnGround( socket, pItem, dropPos );
// Item dropped on another item
else if ( iCont )
dropOnItem( socket, pItem, iCont, dropPos );
// Item dropped on char
else if ( cCont )
dropOnChar( socket, pItem, cCont );
// Handle the sound-effect
if ( pItem->id() == 0xEED )
pChar->goldSound( pItem->amount() );
// Update our weight.
if ( weight != pChar->weight() )
socket->sendStatWindow();
}