@@ -39,13 +39,12 @@ ActorAdditionalData* Actor_GetAdditionalData(z64_actor_t* actor) {
39
39
// Store the flag using the pointer
40
40
void Actor_BuildFlag (z64_actor_t * actor , xflag_t * flag , uint16_t actor_index , uint8_t subflag ) {
41
41
flag -> scene = z64_game .scene_index ;
42
- if (z64_game .scene_index == 0x3E ) {
42
+ if (z64_game .scene_index == 0x3E ) {
43
43
flag -> grotto .room = actor -> room_index ;
44
44
flag -> grotto .grotto_id = z64_file .grotto_id & 0x1F ;
45
45
flag -> grotto .flag = actor_index ;
46
46
flag -> grotto .subflag = subflag ;
47
- }
48
- else {
47
+ } else {
49
48
flag -> room = actor -> room_index ;
50
49
flag -> setup = curr_scene_setup ;
51
50
flag -> flag = actor_index ;
@@ -70,11 +69,11 @@ void Actor_After_UpdateAll_Hack(z64_actor_t* actor, z64_game_t* game) {
70
69
void Actor_StoreFlag (z64_actor_t * actor , z64_game_t * game , xflag_t flag ) {
71
70
ActorAdditionalData * extra = Actor_GetAdditionalData (actor );
72
71
flag = resolve_alternative_flag (& flag );
73
- if (CURR_ACTOR_SPAWN_INDEX )
72
+ if (CURR_ACTOR_SPAWN_INDEX ) {
74
73
extra -> actor_id = CURR_ACTOR_SPAWN_INDEX ;
74
+ }
75
75
override_t override = lookup_override_by_newflag (& flag );
76
- switch (actor -> actor_id )
77
- {
76
+ switch (actor -> actor_id ) {
78
77
// For the following actors we store the flag in the new space added to the actor.
79
78
case OBJ_TSUBO :
80
79
case EN_TUBO_TRAP :
@@ -85,8 +84,7 @@ void Actor_StoreFlag(z64_actor_t* actor, z64_game_t* game, xflag_t flag) {
85
84
case EN_WONDER_ITEM :
86
85
{
87
86
// For these actors, only store the flag if there is a valid override
88
- if (override .key .all )
89
- {
87
+ if (override .key .all ) {
90
88
extra -> flag = flag ;
91
89
}
92
90
break ;
@@ -99,8 +97,7 @@ void Actor_StoreFlag(z64_actor_t* actor, z64_game_t* game, xflag_t flag) {
99
97
// Don't really need to do this since we will recalculate the flag and check the override when spawning the subflags.
100
98
extra -> flag = flag ;
101
99
}
102
- default :
103
- {
100
+ default : {
104
101
break ;
105
102
}
106
103
}
@@ -119,8 +116,8 @@ void Actor_StoreFlagByIndex(z64_actor_t* actor, z64_game_t* game, uint16_t actor
119
116
// Get an override for new flag. If the override doesn't exist, or flag has already been set, return 0.
120
117
override_t get_newflag_override (xflag_t * flag ) {
121
118
override_t override = lookup_override_by_newflag (flag );
122
- if (override .key .all != 0 ) {
123
- if (!Get_NewFlag (flag )) {
119
+ if (override .key .all != 0 ) {
120
+ if (!Get_NewFlag (flag )) {
124
121
return override ;
125
122
}
126
123
}
@@ -133,30 +130,21 @@ void Actor_StoreChestType(z64_actor_t* actor, z64_game_t* game) {
133
130
uint8_t * pChestType = NULL ;
134
131
override_t override = { 0 };
135
132
xflag_t * flag = & (Actor_GetAdditionalData (actor )-> flag );
136
- if (actor -> actor_id == OBJ_TSUBO ) //Pots
137
- {
133
+ if (actor -> actor_id == OBJ_TSUBO ) { // Pots
138
134
override = get_newflag_override (flag );
139
135
pChestType = & (((ObjTsubo * )actor )-> chest_type );
140
- }
141
- else if (actor -> actor_id == EN_TUBO_TRAP ) // Flying Pots
142
- {
136
+ } else if (actor -> actor_id == EN_TUBO_TRAP ) { // Flying Pots
143
137
override = get_newflag_override (flag );
144
138
pChestType = & (((EnTuboTrap * )actor )-> chest_type );
145
- }
146
- else if (actor -> actor_id == OBJ_KIBAKO2 ) // Large Crates
147
- {
139
+ } else if (actor -> actor_id == OBJ_KIBAKO2 ) { // Large Crates
148
140
override = get_newflag_override (flag );
149
141
pChestType = & (((ObjKibako2 * )actor )-> chest_type );
150
- }
151
- else if (actor -> actor_id == OBJ_KIBAKO ) // Small wooden crates
152
- {
142
+ } else if (actor -> actor_id == OBJ_KIBAKO ) { // Small wooden crates
153
143
override = get_newflag_override (flag );
154
144
pChestType = & (((ObjKibako * )actor )-> chest_type );
155
- }
156
- else if (actor -> actor_id == OBJ_COMB )
157
- {
145
+ } else if (actor -> actor_id == OBJ_COMB ) {
158
146
override = get_newflag_override (flag );
159
- pChestType = & (((ObjComb * )actor )-> chest_type );
147
+ pChestType = & (((ObjComb * )actor )-> chest_type );
160
148
}
161
149
if (override .key .all != 0 && pChestType != NULL ) { // If we don't have an override key, then either this item doesn't have an override entry, or it has already been collected.
162
150
if (POTCRATE_TEXTURES_MATCH_CONTENTS == PTMC_UNCHECKED && override .key .all > 0 ) { // For "unchecked" PTMC setting: Check if we have an override which means it wasn't collected.
@@ -206,11 +194,11 @@ bool spawn_override_silver_rupee(ActorEntry* actorEntry, z64_game_t* globalCtx,
206
194
* overridden = false;
207
195
if (SHUFFLE_SILVER_RUPEES ) { // Check if silver rupee shuffle is enabled.
208
196
xflag_t flag = {
209
- .scene = globalCtx -> scene_index ,
210
- .setup = curr_scene_setup ,
211
- .room = globalCtx -> room_index ,
212
- .flag = CURR_ACTOR_SPAWN_INDEX ,
213
- .subflag = 0
197
+ .scene = globalCtx -> scene_index ,
198
+ .setup = curr_scene_setup ,
199
+ .room = globalCtx -> room_index ,
200
+ .flag = CURR_ACTOR_SPAWN_INDEX ,
201
+ .subflag = 0 ,
214
202
};
215
203
216
204
flag = resolve_alternative_flag (& flag );
@@ -253,10 +241,9 @@ z64_actor_t* Player_SpawnEntry_Hack(void* actorCtx, ActorEntry* playerEntry, z64
253
241
}
254
242
255
243
// This is our entrypoint back into Actor_Spawn. Call/return this to spawn the actor
256
- extern z64_actor_t * Actor_Spawn_Continue (void * actorCtx , z64_game_t * globalCtx , int16_t actorId , float posX , float posY , float posZ , int16_t rotX , int16_t rotY , int16_t rotZ , int16_t params );
244
+ extern z64_actor_t * Actor_Spawn_Continue (void * actorCtx , z64_game_t * globalCtx , int16_t actorId , float posX , float posY , float posZ , int16_t rotX , int16_t rotY , int16_t rotZ , int16_t params );
257
245
258
- z64_actor_t * Actor_Spawn_Hook (void * actorCtx , z64_game_t * globalCtx , int16_t actorId ,
259
- float posX , float posY , float posZ , int16_t rotX , int16_t rotY , int16_t rotZ , int16_t params ) {
246
+ z64_actor_t * Actor_Spawn_Hook (void * actorCtx , z64_game_t * globalCtx , int16_t actorId , float posX , float posY , float posZ , int16_t rotX , int16_t rotY , int16_t rotZ , int16_t params ) {
260
247
bool continue_spawn = true;
261
248
262
249
ActorEntry entry ;
@@ -269,11 +256,10 @@ z64_actor_t * Actor_Spawn_Hook(void* actorCtx, z64_game_t* globalCtx, int16_t ac
269
256
entry .rot .y = rotY ;
270
257
entry .rot .z = rotZ ;
271
258
272
- if (continue_spawn ) {
259
+ if (continue_spawn ) {
273
260
z64_actor_t * spawned = Actor_Spawn_Continue (actorCtx , globalCtx , actorId , posX , posY , posZ , rotX , rotY , rotZ , params );
274
- if (spawned ) {
275
- if (spawn_actor_with_flag )
276
- {
261
+ if (spawned ) {
262
+ if (spawn_actor_with_flag ) {
277
263
Actor_StoreFlag (spawned , globalCtx , * spawn_actor_with_flag );
278
264
Actor_StoreChestType (spawned , globalCtx );
279
265
}
0 commit comments