Improve chain chomp syncing
This commit is contained in:
parent
edb38087cb
commit
b1651e96b6
|
@ -2,4 +2,4 @@ set -e
|
||||||
make BETTERCAMERA=1 NODRAWINGDISTANCE=1 DEBUG=1 IMMEDIATELOAD=1
|
make BETTERCAMERA=1 NODRAWINGDISTANCE=1 DEBUG=1 IMMEDIATELOAD=1
|
||||||
./build/us_pc/sm64.us.f3dex2e.exe --server --configfile sm64config_server.txt &
|
./build/us_pc/sm64.us.f3dex2e.exe --server --configfile sm64config_server.txt &
|
||||||
#./build/us_pc/sm64.us.f3dex2e.exe --client --configfile sm64config_client.txt &
|
#./build/us_pc/sm64.us.f3dex2e.exe --client --configfile sm64config_client.txt &
|
||||||
winpty cgdb ./build/us_pc/sm64.us.f3dex2e.exe -ex 'break debug_breakpoint_here' -ex 'run --client --configfile sm64config_client.txt' -ex 'quit'
|
winpty cgdb ./build/us_pc/sm64.us.f3dex2e.exe -ex 'break debug_breakpoint_here' -ex 'run --client --configfile sm64config_client.txt' -ex 'quit'
|
||||||
|
|
|
@ -493,6 +493,8 @@ static void chain_chomp_act_unload_chain(void) {
|
||||||
void bhv_chain_chomp_update(void) {
|
void bhv_chain_chomp_update(void) {
|
||||||
if (o->oSyncID == 0) {
|
if (o->oSyncID == 0) {
|
||||||
network_init_object(o, 1000.0f);
|
network_init_object(o, 1000.0f);
|
||||||
|
network_init_object_field(o, &o->oChainChompUnk104);
|
||||||
|
network_init_object_field(o, &o->header.gfx.unk38.animFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (o->oAction) {
|
switch (o->oAction) {
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "../network.h"
|
#include "../network.h"
|
||||||
#include "object_fields.h"
|
#include "object_fields.h"
|
||||||
#include "object_constants.h"
|
#include "object_constants.h"
|
||||||
|
#include "behavior_data.h"
|
||||||
|
|
||||||
u8 nextSyncID = 1;
|
u8 nextSyncID = 1;
|
||||||
struct SyncObject syncObjects[MAX_SYNC_OBJECTS] = { 0 };
|
struct SyncObject syncObjects[MAX_SYNC_OBJECTS] = { 0 };
|
||||||
|
@ -60,6 +61,7 @@ void network_send_object(struct Object* o) {
|
||||||
packet_write(&p, &o->oInteractStatus, 4);
|
packet_write(&p, &o->oInteractStatus, 4);
|
||||||
packet_write(&p, &o->oHeldState, 4);
|
packet_write(&p, &o->oHeldState, 4);
|
||||||
packet_write(&p, &o->oMoveAngleYaw, 4);
|
packet_write(&p, &o->oMoveAngleYaw, 4);
|
||||||
|
packet_write(&p, &o->oTimer, 4);
|
||||||
|
|
||||||
packet_write(&p, &so->extraFieldCount, 1);
|
packet_write(&p, &so->extraFieldCount, 1);
|
||||||
for (int i = 0; i < so->extraFieldCount; i++) {
|
for (int i = 0; i < so->extraFieldCount; i++) {
|
||||||
|
@ -132,6 +134,7 @@ void network_receive_object(struct Packet* p) {
|
||||||
packet_read(p, &o->oInteractStatus, 4);
|
packet_read(p, &o->oInteractStatus, 4);
|
||||||
packet_read(p, &o->oHeldState, 4);
|
packet_read(p, &o->oHeldState, 4);
|
||||||
packet_read(p, &o->oMoveAngleYaw, 4);
|
packet_read(p, &o->oMoveAngleYaw, 4);
|
||||||
|
packet_read(p, &o->oTimer, 4);
|
||||||
|
|
||||||
// write extra fields
|
// write extra fields
|
||||||
u8 extraFields = 0;
|
u8 extraFields = 0;
|
||||||
|
|
Loading…
Reference in New Issue