Synchronized TTC spinner

This commit is contained in:
MysterD 2020-10-11 14:39:32 -07:00
parent 7167c8537b
commit f64e315c74
1 changed files with 9 additions and 0 deletions

View File

@ -17,6 +17,15 @@ static s16 sTTCSpinnerSpeeds[] = {
* Update function for bhvTTCSpinner.
*/
void bhv_ttc_spinner_update(void) {
if (!network_sync_object_initialized(o)) {
struct SyncObject* so = network_init_object(o, 4000.0f);
so->minUpdateRate = 5.0f;
network_init_object_field(o, &o->oAngleVelPitch);
network_init_object_field(o, &o->oFaceAnglePitch);
network_init_object_field(o, &o->oTTCSpinnerDir);
network_init_object_field(o, &o->oTTCChangeDirTimer);
}
o->oAngleVelPitch = sTTCSpinnerSpeeds[gTTCSpeedSetting];
if (gTTCSpeedSetting == TTC_SPEED_RANDOM) {