Sync'd wooden posts coin status on late join

This commit is contained in:
MysterD 2022-03-29 18:45:17 -07:00
parent 7589a2b361
commit b0a801cf8c
1 changed files with 10 additions and 7 deletions

View File

@ -88,13 +88,13 @@ static void network_send_level_macro_area(struct NetworkPlayer* destNp, u8 areaI
// check for special cases // check for special cases
const BehaviorScript* behavior = MacroObjectPresets[presetID].behavior; const BehaviorScript* behavior = MacroObjectPresets[presetID].behavior;
if ((behavior == bhvCoinFormation) && *respawnInfo != 0) { bool writable = (*respawnInfo != 0) && (
*macroSpecialCount = *macroSpecialCount + 1; (behavior == bhvCoinFormation) ||
u16 offset = respawnInfo - area->macroObjects; (behavior == bhvGoombaTripletSpawner) ||
packet_write(&p, &offset, sizeof(u16)); (behavior == bhvWoodenPost)
packet_write(&p, respawnInfo, sizeof(s16)); );
LOG_INFO("tx macro special: offset %d, respawnInfo %d", offset, *respawnInfo);
} else if ((behavior == bhvGoombaTripletSpawner) && *respawnInfo != 0) { if (writable) {
*macroSpecialCount = *macroSpecialCount + 1; *macroSpecialCount = *macroSpecialCount + 1;
u16 offset = respawnInfo - area->macroObjects; u16 offset = respawnInfo - area->macroObjects;
packet_write(&p, &offset, sizeof(u16)); packet_write(&p, &offset, sizeof(u16));
@ -226,6 +226,9 @@ void network_receive_level_macro(struct Packet* p) {
} }
} }
LOG_INFO("rx macro special: goomba triplet"); LOG_INFO("rx macro special: goomba triplet");
} else if (behavior == bhvWoodenPost) {
o->oBehParams |= WOODEN_POST_BP_NO_COINS_MASK;
LOG_INFO("rx macro special: wooden post");
} }
} }
} }