---------------------------------------- DeadThink ---------------------------------------- */
| 752 | ---------------------------------------- |
| 753 | */ |
| 754 | static void DeadThink ( void ) |
| 755 | { |
| 756 | trace_t trace; |
| 757 | //HACKHACKHACKHACKHACK |
| 758 | //We should really have a seperate G2 bounding box (seperate from the physics bbox) for G2 collisions only |
| 759 | //FIXME: don't ever inflate back up? |
| 760 | //GAH! With Ragdoll, they get stuck in the ceiling |
| 761 | float oldMaxs2 = NPC->maxs[2]; |
| 762 | NPC->maxs[2] = NPC->client->renderInfo.eyePoint[2] - NPC->currentOrigin[2] + 4; |
| 763 | if ( NPC->maxs[2] < -8 ) |
| 764 | { |
| 765 | NPC->maxs[2] = -8; |
| 766 | } |
| 767 | if ( NPC->maxs[2] > oldMaxs2 ) |
| 768 | {//inflating maxs, make sure we're not inflating into solid |
| 769 | gi.trace (&trace, NPC->currentOrigin, NPC->mins, NPC->maxs, NPC->currentOrigin, NPC->s.number, NPC->clipmask, (EG2_Collision)0, 0 ); |
| 770 | if ( trace.allsolid ) |
| 771 | {//must be inflating |
| 772 | NPC->maxs[2] = oldMaxs2; |
| 773 | } |
| 774 | } |
| 775 | /* |
| 776 | { |
| 777 | if ( VectorCompare( NPC->client->ps.velocity, vec3_origin ) ) |
| 778 | {//not flying through the air |
| 779 | if ( NPC->mins[0] > -32 ) |
| 780 | { |
| 781 | NPC->mins[0] -= 1; |
| 782 | gi.trace (&trace, NPC->currentOrigin, NPC->mins, NPC->maxs, NPC->currentOrigin, NPC->s.number, NPC->clipmask ); |
| 783 | if ( trace.allsolid ) |
| 784 | { |
| 785 | NPC->mins[0] += 1; |
| 786 | } |
| 787 | } |
| 788 | if ( NPC->maxs[0] < 32 ) |
| 789 | { |
| 790 | NPC->maxs[0] += 1; |
| 791 | gi.trace (&trace, NPC->currentOrigin, NPC->mins, NPC->maxs, NPC->currentOrigin, NPC->s.number, NPC->clipmask ); |
| 792 | if ( trace.allsolid ) |
| 793 | { |
| 794 | NPC->maxs[0] -= 1; |
| 795 | } |
| 796 | } |
| 797 | if ( NPC->mins[1] > -32 ) |
| 798 | { |
| 799 | NPC->mins[1] -= 1; |
| 800 | gi.trace (&trace, NPC->currentOrigin, NPC->mins, NPC->maxs, NPC->currentOrigin, NPC->s.number, NPC->clipmask ); |
| 801 | if ( trace.allsolid ) |
| 802 | { |
| 803 | NPC->mins[1] += 1; |
| 804 | } |
| 805 | } |
| 806 | if ( NPC->maxs[1] < 32 ) |
| 807 | { |
| 808 | NPC->maxs[1] += 1; |
| 809 | gi.trace (&trace, NPC->currentOrigin, NPC->mins, NPC->maxs, NPC->currentOrigin, NPC->s.number, NPC->clipmask ); |
| 810 | if ( trace.allsolid ) |
| 811 | { |
no test coverage detected