/** * Save guests to the save game. * @param svr Output stream to save to. */ void Guests::Save(Saver &svr) { svr.StartBlock("GSTS", 1); svr.PutWord(this->start_voxel.x); svr.PutWord(this->start_voxel.y); svr.PutWord(this->daily_frac); svr.PutWord(this->next_daily_index); svr.PutLong(this->free_idx); svr.PutLong(this->CountActiveGuests()); for (uint i = 0; i < GUEST_BLOCK_SIZE; i++) { Guest *g = this->block.Get(i); if (g->IsActive()) { svr.PutWord(g->id); g->Save(svr); } } svr.EndBlock(); }
/** * Write a voxel to the save game. * @param svr Output stream to write. */ void Voxel::Save(Saver &svr) const { svr.PutLong(this->ground); if (this->instance >= SRI_RIDES_START && this->instance < SRI_FULL_RIDES) { svr.PutByte(this->instance); svr.PutWord(this->instance_data); } else { svr.PutByte(SRI_FREE); // Full rides save their own data from the world. } svr.PutWord(this->fences); }