103 {
105 f32 x, y, z;
106 s32 airborne;
107 f32 currentX, currentY, currentZ;
108 f32 dist;
110 f32 targetX, targetY, targetZ;
111 f32 theta;
112 f32 yaw;
113
115
119 targetX = historyPoint->
pos.
x;
120 targetY = historyPoint->
pos.
y;
121 targetZ = historyPoint->
pos.
z;
122 currentX = npc->
pos.
x;
123 currentY = npc->
pos.
y;
124 currentZ = npc->
pos.
z;
126
130 }
131
135 }
136
137 while (TRUE) {
138 dist =
dist2D(currentX, currentZ, targetX, targetZ);
139 yaw =
atan2(currentX, currentZ, targetX, targetZ);
141 dist =
dist2D(currentX, currentZ, x, z);
143 break;
144 }
145
150 } else {
152 }
153 break;
154 }
155 }
156
161 break;
162 }
163
165 if (dist <= followData->idleRadius) {
170 break;
171 }
172
176 }
178 targetX = historyPoint->
pos.
x;
179 targetZ = historyPoint->
pos.
z;
183 break;
184 }
185 }
186 }
187
190 }
195 }
196 break;
202 }
204 targetX = historyPoint->
pos.
x;
205 targetY = historyPoint->
pos.
y;
206 targetZ = historyPoint->
pos.
z;
218 dist = currentY;
219 }
220 if (dist < followData->idleRadius) {
225 return;
226 }
230 }
234 npc->
flags &= ~NPC_FLAG_GRAVITY;
236 }
237 break;
243 }
246 currentX = npc->
pos.
x;
248 currentY = npc->
pos.
y + dist;
249 currentZ = npc->
pos.
z;
252 {
255 npc->
pos.
y = currentY;
257 npc->
yaw =
atan2(currentX, currentZ, x, z);
259 }
260 }
261 break;
264 targetX = historyPoint->
pos.
x;
265 targetY = historyPoint->
pos.
y;
266 targetZ = historyPoint->
pos.
z;
267 currentX = npc->
pos.
x;
268 currentY = npc->
pos.
y;
269 currentZ = npc->
pos.
z;
271 if (dist <= followData->idleRadius) {
272 break;
273 }
274
275 while (TRUE) {
277 break;
278 }
279
282 break;
283 }
284
286 break;
287 }
288
292 }
294 targetX = historyPoint->
pos.
x;
295 targetZ = historyPoint->
pos.
z;
296 continue;
297 }
298
301 return;
302 }
303
304 while (TRUE) {
306 break;
307 }
308
311 break;
312 }
313
315 break;
316 }
317
321 }
323 targetX = historyPoint->
pos.
x;
324 targetZ = historyPoint->
pos.
z;
325 }
327 break;
328 }
329}
#define npc_raycast_down_sides
@ NPC_FLAG_COLLDING_FORWARD_WITH_WORLD
f32 get_clamped_angle_diff(f32, f32)
void npc_move_heading(Npc *npc, f32 speed, f32 yaw)