| 1781 | } |
| 1782 | |
| 1783 | TMError Entity::TransferMsg(NetworkMessageContext& ctx) |
| 1784 | { |
| 1785 | switch (ctx.GetClass()) |
| 1786 | { |
| 1787 | case NMCCreate: |
| 1788 | TMCHECK(NetworkObject::TransferMsg(ctx)) |
| 1789 | if (ctx.IsSending()) |
| 1790 | { |
| 1791 | PoseidonAssert(dynamic_cast<const IndicesCreateVehicle*>(ctx.GetIndices())) |
| 1792 | const IndicesCreateVehicle* indices = static_cast<const IndicesCreateVehicle*>(ctx.GetIndices()); |
| 1793 | |
| 1794 | RString type = GetName() ? GetName() : ""; |
| 1795 | TMCHECK(ctx.IdxTransfer(indices->type, type)) |
| 1796 | RString shape = _shape ? _shape->Name() : ""; |
| 1797 | TMCHECK(ctx.IdxTransfer(indices->shape, shape)) |
| 1798 | Vector3& position = const_cast<Vector3&>(Position()); |
| 1799 | TMCHECK(ctx.IdxTransfer(indices->position, position)) |
| 1800 | TMCHECK(ctx.IdxTransferRef(indices->hierParent, _hierParent)) |
| 1801 | } |
| 1802 | break; |
| 1803 | case NMCUpdateGeneric: |
| 1804 | TMCHECK(base::TransferMsg(ctx)) |
| 1805 | { |
| 1806 | PoseidonAssert(dynamic_cast<const IndicesUpdateVehicle*>(ctx.GetIndices())) |
| 1807 | const IndicesUpdateVehicle* indices = static_cast<const IndicesUpdateVehicle*>(ctx.GetIndices()); |
| 1808 | ITRANSF_ENUM(targetSide) |
| 1809 | if (ctx.IsSending()) |
| 1810 | { |
| 1811 | AUTO_STATIC_ARRAY(float, animations, 32); |
| 1812 | animations.Resize(_animations.Size()); |
| 1813 | for (int i = 0; i < _animations.Size(); i++) |
| 1814 | { |
| 1815 | animations[i] = _animations[i].GetPhaseWanted(); |
| 1816 | } |
| 1817 | TMCHECK(ctx.IdxTransfer(indices->animations, animations)) |
| 1818 | } |
| 1819 | else |
| 1820 | { |
| 1821 | AUTO_STATIC_ARRAY(float, animations, 32); |
| 1822 | TMCHECK(ctx.IdxTransfer(indices->animations, animations)) |
| 1823 | for (int i = 0; i < _animations.Size(); i++) |
| 1824 | { |
| 1825 | if (i < animations.Size()) |
| 1826 | { |
| 1827 | _animations[i].SetPhaseWanted(animations[i]); |
| 1828 | } |
| 1829 | } |
| 1830 | } |
| 1831 | } |
| 1832 | break; |
| 1833 | case NMCUpdatePosition: |
| 1834 | TMCHECK(base::TransferMsg(ctx)) |
| 1835 | { |
| 1836 | PoseidonAssert(dynamic_cast<const IndicesUpdatePositionVehicle*>(ctx.GetIndices())) |
| 1837 | const IndicesUpdatePositionVehicle* indices = |
| 1838 | static_cast<const IndicesUpdatePositionVehicle*>(ctx.GetIndices()); |
| 1839 | if (ctx.IsSending()) |
| 1840 | { |
nothing calls this directly
no test coverage detected