MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / zTaxi_Update

Function zTaxi_Update

src/SB/Game/zTaxi.cpp:67–193  ·  view source on GitHub ↗

Nonmatch due to regalloc, scheduling. https://decomp.me/scratch/1o3TG

Source from the content-addressed store, hash-verified

65
66// Nonmatch due to regalloc, scheduling. https://decomp.me/scratch/1o3TG
67void zTaxi_Update(xBase* to, xScene*, F32 dt)
68{
69 zTaxi* taxi = (zTaxi*)to;
70
71 xCylinder cylinder;
72 xVec3Copy(&cylinder.center, &taxi->pos);
73 cylinder.r = taxi->radius;
74 cylinder.h = 5.0f;
75 xIsect isect;
76 iCylinderIsectVec(&cylinder, (xVec3*)&globals.player.ent.model->Mat->pos, &isect);
77 if (isect.penned == -1.0f && xBaseIsEnabled((xBase*)taxi))
78 {
79 if (taxi->currState == 0)
80 {
81 sAnswer = ztalkbox::ANSWER_3;
82 taxi->currState = 1;
83 taxi->radius = 2.5f;
84 }
85 }
86 else
87 {
88 taxi->currState = 0;
89 taxi->radius = 1.3f;
90 }
91
92 switch (taxi->currState)
93 {
94 case 0:
95 break;
96 case 1:
97 if (gCurrentPlayer == NULL && globals.player.JumpState == 0)
98 {
99 if (sAnswer == 1)
100 {
101 taxi->currState = 3;
102 zEntPlayer_SNDPlay(ePlayerSnd_Taxi, 0.0f);
103 zEntPlayer_SNDPlay(ePlayerSnd_Bus, 0.2f);
104 }
105 if (sAnswer == 2)
106 {
107 taxi->currState = 2;
108 }
109 }
110 break;
111 case 2:
112 zEntPlayerControlOn(CONTROL_OWNER_TAXI);
113 break;
114 case 3:
115 case 5:
116 break;
117 }
118
119 if (taxi->prevState != taxi->currState)
120 {
121 switch (taxi->currState)
122 {
123 case 0:
124 zEntEvent(taxi->basset->talkBoxID, eEventEndConversation);

Callers 1

zSceneUpdateFunction · 0.70

Calls 12

xVec3CopyFunction · 0.85
xBaseIsEnabledFunction · 0.85
zEntPlayer_SNDPlayFunction · 0.85
zSceneFindObjectFunction · 0.85
xEntHideFunction · 0.85
zEntPlayerControlOnFunction · 0.70
zEntPlayerControlOffFunction · 0.70
iCylinderIsectVecFunction · 0.50
zEntEventFunction · 0.50
xStrHashFunction · 0.50
start_talkMethod · 0.45
set_textMethod · 0.45

Tested by

no test coverage detected