---------------------------------------- DeadThink ---------------------------------------- */
| 669 | ---------------------------------------- |
| 670 | */ |
| 671 | static void DeadThink ( void ) |
| 672 | { |
| 673 | trace_t trace; |
| 674 | |
| 675 | //HACKHACKHACKHACKHACK |
| 676 | //We should really have a seperate G2 bounding box (seperate from the physics bbox) for G2 collisions only |
| 677 | //FIXME: don't ever inflate back up? |
| 678 | NPC->maxs[2] = NPC->client->renderInfo.eyePoint[2] - NPC->currentOrigin[2] + 4; |
| 679 | if ( NPC->maxs[2] < -8 ) |
| 680 | { |
| 681 | NPC->maxs[2] = -8; |
| 682 | } |
| 683 | if ( VectorCompare( NPC->client->ps.velocity, vec3_origin ) ) |
| 684 | {//not flying through the air |
| 685 | if ( NPC->mins[0] > -32 ) |
| 686 | { |
| 687 | NPC->mins[0] -= 1; |
| 688 | gi.trace (&trace, NPC->currentOrigin, NPC->mins, NPC->maxs, NPC->currentOrigin, NPC->s.number, NPC->clipmask, G2_NOCOLLIDE, 0 ); |
| 689 | if ( trace.allsolid ) |
| 690 | { |
| 691 | NPC->mins[0] += 1; |
| 692 | } |
| 693 | } |
| 694 | if ( NPC->maxs[0] < 32 ) |
| 695 | { |
| 696 | NPC->maxs[0] += 1; |
| 697 | gi.trace (&trace, NPC->currentOrigin, NPC->mins, NPC->maxs, NPC->currentOrigin, NPC->s.number, NPC->clipmask, G2_NOCOLLIDE, 0 ); |
| 698 | if ( trace.allsolid ) |
| 699 | { |
| 700 | NPC->maxs[0] -= 1; |
| 701 | } |
| 702 | } |
| 703 | if ( NPC->mins[1] > -32 ) |
| 704 | { |
| 705 | NPC->mins[1] -= 1; |
| 706 | gi.trace (&trace, NPC->currentOrigin, NPC->mins, NPC->maxs, NPC->currentOrigin, NPC->s.number, NPC->clipmask, G2_NOCOLLIDE, 0 ); |
| 707 | if ( trace.allsolid ) |
| 708 | { |
| 709 | NPC->mins[1] += 1; |
| 710 | } |
| 711 | } |
| 712 | if ( NPC->maxs[1] < 32 ) |
| 713 | { |
| 714 | NPC->maxs[1] += 1; |
| 715 | gi.trace (&trace, NPC->currentOrigin, NPC->mins, NPC->maxs, NPC->currentOrigin, NPC->s.number, NPC->clipmask, G2_NOCOLLIDE, 0 ); |
| 716 | if ( trace.allsolid ) |
| 717 | { |
| 718 | NPC->maxs[1] -= 1; |
| 719 | } |
| 720 | } |
| 721 | } |
| 722 | //HACKHACKHACKHACKHACK |
| 723 | |
| 724 | //FIXME: tilt and fall off of ledges? |
| 725 | //NPC_PostDeathThink(); |
| 726 | |
| 727 | /* |
| 728 | if ( !NPCInfo->timeOfDeath && NPC->client != NULL && NPCInfo != NULL ) |
no test coverage detected