| 822 | } |
| 823 | |
| 824 | void start() |
| 825 | { |
| 826 | if ((shared.flags & 0x7) != 0x3) |
| 827 | { |
| 828 | return; |
| 829 | } |
| 830 | |
| 831 | xEnt& player = globals.player.ent; |
| 832 | const char* anim_name = player.model->Anim->Single->State->Name; |
| 833 | bool found = false; |
| 834 | if (shared.hook == NULL && globals.player.s->pcType == ePlayer_SB && |
| 835 | (strcmp(anim_name, "JumpStart01") || strcmp(anim_name, "JumpLift01") || |
| 836 | strcmp(anim_name, "JumpApex01") || strcmp(anim_name, "DJumpStart01") || |
| 837 | strcmp(anim_name, "DJumpLift01") || strcmp(anim_name, "Fall01") || |
| 838 | strcmp(anim_name, "FallHigh01")) && |
| 839 | globals.player.cheat_mode == 0 && (globals.player.ControlOff & ~0x4000) == 0) |
| 840 | { |
| 841 | found = true; |
| 842 | } |
| 843 | |
| 844 | shared.hook = NULL; |
| 845 | if (found) |
| 846 | { |
| 847 | S32 i = find_nearest_hook(player.frame->mat.pos); |
| 848 | if (i >= 0) |
| 849 | { |
| 850 | shared.hook = shared.hook_cache[i]; |
| 851 | shared.hook->ent = shared.hook_cache[i]->ent; |
| 852 | } |
| 853 | } |
| 854 | |
| 855 | if (shared.hook == NULL) |
| 856 | { |
| 857 | return; |
| 858 | } |
| 859 | |
| 860 | zEntPlayerControlOn(CONTROL_OWNER_SPRINGBOARD); |
| 861 | fade_hook_out(); |
| 862 | init_sounds(); |
| 863 | shared.flags |= 4; |
| 864 | shared.state = shared.states[0]; |
| 865 | shared.state->start(); |
| 866 | } |
| 867 | |
| 868 | void cache_hook(hook_type& hook) |
| 869 | { |
nothing calls this directly
no test coverage detected