Synchronized underwater koopa shell

This commit is contained in:
MysterD 2020-08-18 18:46:54 -07:00
parent f08e6f0806
commit 57a4e746cf
3 changed files with 9 additions and 1 deletions

View File

@ -88,6 +88,7 @@ void bhv_koopa_shell_loop(void) {
koopa_shell_spawn_sparkles(10.0f); koopa_shell_spawn_sparkles(10.0f);
o->oFaceAngleYaw = player->oMoveAngleYaw; o->oFaceAngleYaw = player->oMoveAngleYaw;
if (o->oInteractStatus & INT_STATUS_STOP_RIDING) { if (o->oInteractStatus & INT_STATUS_STOP_RIDING) {
o->heldByPlayerIndex = 0;
obj_mark_for_deletion(o); obj_mark_for_deletion(o);
spawn_mist_particles(); spawn_mist_particles();
o->oAction = 0; o->oAction = 0;

View File

@ -17,6 +17,9 @@ void set_koopa_shell_underwater_hitbox(void) {
} }
void bhv_koopa_shell_underwater_loop(void) { void bhv_koopa_shell_underwater_loop(void) {
if (o->oSyncID == 0) {
network_init_object(o, 500.0f);
}
switch (o->oHeldState) { switch (o->oHeldState) {
case HELD_FREE: case HELD_FREE:
set_koopa_shell_underwater_hitbox(); set_koopa_shell_underwater_hitbox();
@ -26,6 +29,7 @@ void bhv_koopa_shell_underwater_loop(void) {
break; break;
case HELD_THROWN: case HELD_THROWN:
case HELD_DROPPED: case HELD_DROPPED:
o->heldByPlayerIndex = 0;
obj_mark_for_deletion(o); obj_mark_for_deletion(o);
spawn_mist_particles(); spawn_mist_particles();
break; break;

View File

@ -56,7 +56,10 @@ void network_receive_player(struct Packet* p) {
if (heldSyncID != NULL && syncObjects[heldSyncID].o != NULL) { if (heldSyncID != NULL && syncObjects[heldSyncID].o != NULL) {
// TODO: do we have to move graphics nodes around to make this visible? // TODO: do we have to move graphics nodes around to make this visible?
gMarioStates[1].heldObj = syncObjects[heldSyncID].o; gMarioStates[1].heldObj = syncObjects[heldSyncID].o;
gMarioStates[1].heldObj->heldByPlayerIndex = 1; if (gMarioStates[1].heldObj != NULL) {
gMarioStates[1].heldObj->oHeldState = HELD_HELD;
gMarioStates[1].heldObj->heldByPlayerIndex = 1;
}
} else { } else {
gMarioStates[1].heldObj = NULL; gMarioStates[1].heldObj = NULL;
} }