Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Hit Box modifications
- void CCharacter::UpdateHitBox()
- {
- if (!m_hHitBox) return;
- CCharacterHitBox* pHitBox = (CCharacterHitBox*) g_pLTServer->HandleToObject(m_hHitBox);
- if (pHitBox)
- {
- pHitBox->Update();
- }
- }
- void CCharacter::UpdateClientHitBox()
- {
- if (m_hHitBox == INVALID_HOBJECT)
- return;
- LTVector vHitDims, vHitOffset(0.0f, 0.0f, 0.0f);
- g_pPhysicsLT->GetObjectDims(m_hHitBox, &vHitDims);
- bool bCanBeSearched = false;
- CCharacterHitBox* pHitBox = dynamic_cast<CCharacterHitBox*>(g_pLTServer->HandleToObject(m_hHitBox));
- if (pHitBox)
- {
- vHitOffset = pHitBox->GetOffset();
- bCanBeSearched = pHitBox->CanBeSearched();
- }
- // Send the hitbox message
- CAutoMessage cMsg;
- cMsg.Writeuint8(MID_SFX_MESSAGE);
- cMsg.Writeuint8(SFX_CHARACTER_ID);
- cMsg.WriteObject(m_hObject);
- cMsg.Writeuint8(CFX_HITBOX_MSG);
- cMsg.WriteCompLTVector( vHitDims );
- cMsg.WriteCompLTVector( vHitOffset );
- cMsg.Writebool( bCanBeSearched );
- g_pLTServer->SendToClient(cMsg.Read(), LTNULL, MESSAGE_GUARANTEED);
- // Update the SFX
- CreateSpecialFX();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement