MCPcopy Index your code
hub / github.com/assaultcube/AC / popscontext

Function popscontext

source/src/command.cpp:1657–1682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1655}
1656
1657int popscontext()
1658{
1659 ASSERT(contextstack.length() > 0);
1660 int old = execcontext;
1661 execcontext = contextstack.pop();
1662 currentcontextisolated = contextsealed && contextisolated[execcontext];
1663
1664 if(execcontext < old && old >= IEXC_MAPCFG) // clean up aliases created in the old (map cfg) context
1665 {
1666 int limitcontext = max(execcontext + 1, (int) IEXC_MAPCFG); // don't clean up below IEXC_MAPCFG
1667 enumeratekt(*idents, const char *, name, ident, id,
1668 {
1669 if(id.type == ID_ALIAS && id.context >= limitcontext)
1670 {
1671 while(id.stack && id.stack->context >= limitcontext)
1672 popident(id);
1673 if(id.context >= limitcontext)
1674 {
1675 if(id.action != id.executing) delete[] id.action;
1676 idents->remove(name);
1677 }
1678 }
1679 });
1680 }
1681 return execcontext;
1682}
1683
1684#ifndef STANDALONE
1685void scriptcontext(char *context, char *idname)

Callers 6

empty_worldFunction · 0.85
loadmodelFunction · 0.85
load_worldFunction · 0.85
restoreMethod · 0.85
runMethod · 0.85
quitFunction · 0.85

Calls 5

maxFunction · 0.85
enumeratektFunction · 0.85
popidentFunction · 0.85
lengthMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected