Chickens have 28 hitboxes:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | enum EChickenHitboxes { HITBOX_CHICKEN_PELVIS, HITBOX_CHICKEN_LEFTKNEE, HITBOX_CHICKEN_LEFTANKLE, HITBOX_CHICKEN_LEFTBACKTOE, HITBOX_CHICKEN_LEFTTOE, HITBOX_CHICKEN_RIGHTKNEE, HITBOX_CHICKEN_RIGHTANKLE, HITBOX_CHICKEN_RIGHTBACKTOE, HITBOX_CHICKEN_RIGHTTOE, HITBOX_CHICKEN_TAIL, HITBOX_CHICKEN_TAIL1, HITBOX_CHICKEN_TAIL2, HITBOX_CHICKEN_CLAVICAL, // gg misspell valve? HITBOX_CHICKEN_RIGHTBREAST, HITBOX_CHICKEN_RIGHTSHOULDER, HITBOX_CHICKEN_RIGHTELBOW, HITBOX_CHICKEN_RIGHTWRIST, HITBOX_CHICKEN_RIGHTTIP, HITBOX_CHICKEN_LEFTBREAST, HITBOX_CHICKEN_LEFTSHOULDER, HITBOX_CHICKEN_LEFTELBOW, HITBOX_CHICKEN_LEFTWRIST, HITBOX_CHICKEN_LEFTTIP, HITBOX_CHICKEN_NECK1, HITBOX_CHICKEN_NECK2, HITBOX_CHICKEN_NECK3, HITBOX_CHICKEN_HEAD, HITBOX_CHICKEN_WOBBLER }; |
The chickens all have the clientclass CDynamicProp, and you can check wether it's a chicken or not by checking model name; Ex:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | bool CEntity::IsChicken( void ) { const model_t *model = GetModel(); if ( !model ) { LOG_ERROR( "model_t was 0" ); return false ; } studiohdr_t *studioHeader = g_InterfaceManager->ModelInfo()->GetVTable<IVModelInfo>()->GetStudiomodel( model ); if ( !studioHeader ) { LOG_ERROR( "studiohdr_t was 0" ); return false ; } return strstr ( studioHeader->name, "chicken" ); } |
A video of the result:
Ingen kommentarer:
Send en kommentar