Alchemy
Loading...
Searching...
No Matches

object_findcell.h

Go to the documentation of this file.
1#include "types.h"
2#include "field_obj.h"
3
4// Bilibin, its cave, Kalay and Sol Sanctum's entrance.
5
6/// Returns the placed actor (8 to 65) standing on cell (x, z), or 0.
8 struct FieldActor **actors = gEventWork->placedActors - 8;
9 u32 i;
10
11 for (i = 8; i <= 65; i++) {
12 struct FieldActor *actor = actors[i];
13
14 if (x == actor->x.fixed >> 20 && z == actor->z.fixed >> 20) {
15 return actor;
16 }
17 }
18 return 0;
19}
Field objects and actors, and the scene transition styles.
static struct FieldActor * SceneActor_FindActorAtCell(s32 x, s32 z)
Returns the placed actor (8 to 65) standing on cell (x, z), or 0.
struct EventWork * gEventWork
struct FieldActor * placedActors[58]
the placed actors, from id 8
Definition event_work.h:24
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
union FieldCoordinate x
16.16 fixed-point pixels
Definition field_obj.h:35
union FieldCoordinate z
16.16 fixed-point pixels
Definition field_obj.h:37
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
s32 fixed
16.16 fixed-point pixels