mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 13:35:12 +00:00
Make send_spawn_objects more reliable
As noticed by anuserlol, stars would sometimes not spawn from breakable boxes on the remote. This was due to the box being destroyed before the star spawned, when the star tried to spawn it couldn't find the parent and gave up. Now if no parent is found the spawned object will be its own parent. This should make all spawned objects more reliable, but may cause weirdness somewhere. Fixes #34
This commit is contained in:
parent
88b935e9dd
commit
f8044a5639
1 changed files with 7 additions and 1 deletions
|
@ -108,7 +108,13 @@ void network_receive_spawn_objects(struct Packet* p) {
|
|||
parentObj = (i == 0)
|
||||
? gSyncObjects[data.parentId].o
|
||||
: spawned[data.parentId];
|
||||
if (parentObj == NULL) { continue; }
|
||||
if (parentObj == NULL) {
|
||||
// failed to find parent, make it it's own parent
|
||||
// may cause issues, but we want it to spawn!
|
||||
printf("ERROR: failed to find spawn object's parent (%d)!\n", data.parentId);
|
||||
parentObj = gMarioStates[0].marioObj;
|
||||
data.parentId = (u8)-1;
|
||||
}
|
||||
}
|
||||
|
||||
void* behavior = (void*)get_behavior_from_id(data.behaviorId);
|
||||
|
|
Loading…
Reference in a new issue