mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 21:45:12 +00:00
Fix red coins, secrets, goomba triplet macros, and count_objects_with_behavior
This commit is contained in:
parent
ab9e4bf6c7
commit
a8f76be263
4 changed files with 5 additions and 4 deletions
|
@ -132,9 +132,9 @@ static void area_check_red_coin_or_secret(void *arg, bool isMacroObject) {
|
|||
} else {
|
||||
bhv = (const BehaviorScript *) arg;
|
||||
}
|
||||
if (bhv == smlua_override_behavior(bhvRedCoin)) {
|
||||
if (bhv == bhvRedCoin) {
|
||||
gAreas[sCurrAreaIndex].numRedCoins++;
|
||||
} else if (bhv == smlua_override_behavior(bhvHiddenStarTrigger)) {
|
||||
} else if (bhv == bhvHiddenStarTrigger) {
|
||||
gAreas[sCurrAreaIndex].numSecrets++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,6 @@ void bhv_hidden_star_loop(void) {
|
|||
}
|
||||
}
|
||||
|
||||
/* TODO: this is likely not a checkpoint but a Secret */
|
||||
void bhv_hidden_star_trigger_loop(void) {
|
||||
if ((o->oInteractStatus & INT_STATUS_INTERACTED) || (gMarioStates[0].visibleToEnemies && obj_check_if_collided_with_object(o, gMarioObjects[0]) == 1)) {
|
||||
struct Object *hiddenStar = cur_obj_nearest_object_with_behavior(bhvHiddenStar);
|
||||
|
|
|
@ -1151,6 +1151,8 @@ s32 count_unimportant_objects(void) {
|
|||
}
|
||||
|
||||
s32 count_objects_with_behavior(const BehaviorScript *behavior) {
|
||||
if (!behavior) { return 0; }
|
||||
behavior = smlua_override_behavior(behavior);
|
||||
uintptr_t *behaviorAddr = segmented_to_virtual(behavior);
|
||||
|
||||
u32 objList = get_object_list_from_behavior(behaviorAddr);
|
||||
|
|
|
@ -207,7 +207,7 @@ void network_receive_level_macro(struct Packet* p) {
|
|||
}
|
||||
}
|
||||
LOG_INFO("rx macro special: coin formation");
|
||||
} else if (behavior == smlua_override_behavior(bhvGoombaTripletSpawner)) {
|
||||
} else if (behavior == bhvGoombaTripletSpawner) {
|
||||
for (s32 i = 0; i < OBJECT_POOL_CAPACITY; i++) {
|
||||
struct Object* o2 = &gObjectPool[i];
|
||||
if (o2->parentObj != o) { continue; }
|
||||
|
|
Loading…
Reference in a new issue