Skip to content

Commit

Permalink
Replace old CreateDataPack with DataPack Method
Browse files Browse the repository at this point in the history
  • Loading branch information
Bara committed Jul 17, 2018
1 parent 70f036e commit a7de113
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions addons/sourcemod/scripting/ttt/ttt.sp
Expand Up @@ -337,32 +337,29 @@ stock void ShowLogs(int client)
return;
}

Handle slPack = CreateDataPack();
DataPack slPack = new DataPack();

if (TTT_IsClientValid(client))
{
WritePackCell(slPack, GetClientUserId(client));
slPack.WriteCell(GetClientUserId(client));
}
else
{
WritePackCell(slPack, 0);
slPack.WriteCell(0);
}

WritePackCell(slPack, index);
slPack.WriteCell(index);
RequestFrame(OnCreate, slPack);
}

public void OnCreate(any data)
public void OnCreate(DataPack pack)
{
ResetPack(data);
pack.Reset();

int userid = ReadPackCell(data);
int index = ReadPackCell(data);
int userid = pack.ReadCell();
int index = pack.ReadCell();

if (view_as<Handle>(data) != null)
{
delete view_as<Handle>(data);
}
delete pack;

int client;
if (userid == 0)
Expand Down Expand Up @@ -418,18 +415,18 @@ public void OnCreate(any data)
return;
}

Handle slPack = CreateDataPack();
DataPack slPack = new DataPack();

if (TTT_IsClientValid(client))
{
WritePackCell(slPack, GetClientUserId(client));
slPack.WriteCell(GetClientUserId(client));
}
else
{
WritePackCell(slPack, 0);
slPack.WriteCell(0);
}

WritePackCell(slPack, index);
slPack.WriteCell(index);
RequestFrame(OnCreate, slPack);
}
}
Expand Down

0 comments on commit a7de113

Please sign in to comment.