Removing an undo...

The undo library on the wiki doesn’t seem to have a function for removing an undo entry from a player’s list. Am I missing something?

Thanks.

For some reason garry didn’t think we need this.

Here’s a hack for getting the undo table
[lua]
function undo.GetTable()

local _,t = debug.getupvalue(undo.Finish,2)

return t[1]

end
[/lua]

Each entry in the table is another table with the following variables



Owner <-undo.SetPlayer
Entities <-table of all entities added with undo.AddEntity
Name <- the name you give in undo.Create
Functions <-table of tables of all functions added with undo.AddFunction (table[1] is the function and talbe[2] is a table of arguments)


Wait, so this will return the first undo in the list of undos?

What if I want to find and alter a specific undo?

Bump. :smithicide:

It would’ve returned the table of undo’s, but don’t mind it now. Garry’s gonna kill the debug library and add this function anyways:wink:

Really? Well, I can’t complain. :smile: