| 656 | } |
| 657 | |
| 658 | LSError VehicleList::Serialize(ParamArchive& ar) |
| 659 | { |
| 660 | if (ar.IsSaving()) |
| 661 | { |
| 662 | RefArray<Entity> mustBeSaved; |
| 663 | for (int i = 0; i < Size(); i++) |
| 664 | { |
| 665 | Entity* veh = Get(i); |
| 666 | if (veh->Object::GetType() == Primary) |
| 667 | { |
| 668 | continue; |
| 669 | } |
| 670 | if (!veh->MustBeSaved()) |
| 671 | { |
| 672 | continue; |
| 673 | } |
| 674 | mustBeSaved.Add(veh); |
| 675 | } |
| 676 | PARAM_CHECK(ar.Serialize("Vehicles", mustBeSaved, 1)) |
| 677 | } |
| 678 | else |
| 679 | { |
| 680 | PARAM_CHECK(ar.Serialize("Vehicles", *(RefArray<Entity>*)this, 1)) |
| 681 | if (ar.GetPass() == ParamArchive::PassFirst) |
| 682 | { |
| 683 | for (int i = 0; i < Size(); i++) |
| 684 | { |
| 685 | Entity* object = Set(i); |
| 686 | object->StartFrame(); |
| 687 | GLOB_LAND->AddObject(object); |
| 688 | } |
| 689 | } |
| 690 | } |
| 691 | return LSOK; |
| 692 | } |
| 693 | |
| 694 | void VehiclesDistributed::Clear() |
| 695 | { |