What is wrong in this code?
PHP Code:
// Create DataPack
DataPack pack = CreateDataPack();
// Write data to DataPack
pack.WriteCell(client);
pack.WriteString("test");
pack.WriteCell(5);
// Get DataPack end position for later
DataPackPos pos = pack.Position;
// Reset DataPack
pack.Reset();
// Read only client id
int client2 = pack.ReadCell();
// Set position to end
pack.Position = pos; // Error here
// Write new data to the end
pack.WriteCell(6);
Logs:
Code:
[SM] Exception reported: Invalid DataPack position, 28 is out of bounds
[SM] Call stack trace:
[SM] [0] DataPack.Position.set
I'm trying also something like (
pos - view_as<DataPackPos>(1)), but this gave me incorrect results.