MCPcopy Create free account
hub / github.com/assaultcube/AC / editundo

Function editundo

source/src/editing.cpp:470–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468}
469
470void editundo()
471{
472 EDIT("undo");
473 bool mp = multiplayer(NULL);
474 if(mp && undos.length() && undos.last()->xs * undos.last()->ys > MAXNETBLOCKSQR)
475 {
476 conoutf("\f3next undo area too big for multiplayer editing");
477 return;
478 }
479 if(undos.empty()) { conoutf("nothing more to undo"); return; }
480 block *p = undos.pop();
481 undolevel--;
482 redos.add(blockcopy(*p));
483 if(editmetakeydown) restoreposition(*p);
484 blockpaste(*p);
485 if(mp) netblockpaste(*p, p->x, p->y, true);
486 freeblock(p);
487 unsavededits++;
488}
489COMMANDN(undo, editundo, "");
490
491void gotoundolevel(char *lev)

Callers 1

gotoundolevelFunction · 0.85

Calls 10

multiplayerFunction · 0.85
blockcopyFunction · 0.85
restorepositionFunction · 0.85
blockpasteFunction · 0.85
netblockpasteFunction · 0.85
freeblockFunction · 0.85
conoutfFunction · 0.70
lengthMethod · 0.45
emptyMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected