| 875 | } |
| 876 | |
| 877 | S32 zNPCCommon::SysEvent(xBase* from, xBase* to, U32 toEvent, const F32* toParam, |
| 878 | xBase* toParamWidget, S32* handled) |
| 879 | { |
| 880 | static NPCMsg npcmsg; |
| 881 | |
| 882 | S32 doOtherEvents = 1; |
| 883 | zNPCCommon* npc = (zNPCCommon*)to; |
| 884 | xVec3 pos = {}; |
| 885 | xVec3 dir = {}; |
| 886 | |
| 887 | *handled = 1; |
| 888 | |
| 889 | switch (toEvent) |
| 890 | { |
| 891 | case eEventSceneEnd: |
| 892 | { |
| 893 | xPsyche* psy = this->psy_instinct; |
| 894 | if (psy) |
| 895 | { |
| 896 | psy->GoalNone(1, 1); |
| 897 | } |
| 898 | break; |
| 899 | } |
| 900 | case eEventNPCSpecial_PlatformSnap: |
| 901 | case eEventNPCSpecial_PlatformFall: |
| 902 | { |
| 903 | memset(&npcmsg, 0, sizeof(npcmsg)); |
| 904 | |
| 905 | npcmsg.msgid = NPC_MID_SYSEVENT; |
| 906 | npcmsg.infotype = NPC_MDAT_SYSEVENT; |
| 907 | npcmsg.from = this->id; |
| 908 | npcmsg.sendto = this->id; |
| 909 | |
| 910 | NPCSysEvent* se = &npcmsg.sysevent; |
| 911 | se->doLinkEvents = 1; |
| 912 | se->handled = 0; |
| 913 | se->to = to; |
| 914 | se->from = from; |
| 915 | se->toEvent = toEvent; |
| 916 | se->toParamWidget = toParamWidget; |
| 917 | |
| 918 | if (!toParam) |
| 919 | { |
| 920 | se->toParam[0] = 0.0f; |
| 921 | se->toParam[1] = 0.0f; |
| 922 | se->toParam[2] = 0.0f; |
| 923 | se->toParam[3] = 0.0f; |
| 924 | } |
| 925 | else |
| 926 | { |
| 927 | se->toParam[0] = toParam[0]; |
| 928 | se->toParam[1] = toParam[1]; |
| 929 | se->toParam[2] = toParam[2]; |
| 930 | se->toParam[3] = toParam[3]; |
| 931 | } |
| 932 | |
| 933 | zNPCMsg_SendMsg(&npcmsg, -1.0f, NULL); |
| 934 |
nothing calls this directly
no test coverage detected