Skip to content

Commit

Permalink
Cleanup timer creation in editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
splewis committed Mar 4, 2016
1 parent 5ab32de commit 8558b6c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripting/retakes/editor_commands.sp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public Action Command_IterateSpawns(int client, int args) {
DataPack pack = new DataPack();
pack.WriteCell(GetClientSerial(client));
pack.WriteCell(startIndex);
CreateTimer(2.0, Timer_IterateSpawns, pack);
CreateDataTimer(2.0, Timer_IterateSpawns, pack);
return Plugin_Handled;
}

Expand All @@ -162,7 +162,6 @@ public Action Timer_IterateSpawns(Handle timer, Handle data) {
int serial = pack.ReadCell();
int spawnIndex = pack.ReadCell();
int client = GetClientFromSerial(serial);
delete pack;

if (!IsPlayer(client))
return Plugin_Handled;
Expand All @@ -178,7 +177,7 @@ public Action Timer_IterateSpawns(Handle timer, Handle data) {
pack = new DataPack();
pack.WriteCell(serial);
pack.WriteCell(spawnIndex);
CreateTimer(2.0, Timer_IterateSpawns, pack);
CreateDataTimer(2.0, Timer_IterateSpawns, pack);
}

return Plugin_Handled;
Expand Down

0 comments on commit 8558b6c

Please sign in to comment.