MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / addCmd_removeTrigger

Method addCmd_removeTrigger

Engine/source/ts/tsShapeConstruct.cpp:2931–2962  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2929}
2930
2931bool TSShapeConstructor::ChangeSet::addCmd_removeTrigger(const TSShapeConstructor::ChangeSet::Command& newCmd)
2932{
2933 // Remove a matching addTrigger command, but stop if the sequence is used as
2934 // a source for addSequence (since triggers are copied).
2935
2936 for (S32 index = mCommands.size() - 1; index >= 0; index--)
2937 {
2938 Command& cmd = mCommands[index];
2939 switch (cmd.type)
2940 {
2941 case CmdAddTrigger:
2942 if (namesEqual(cmd.argv[0], newCmd.argv[0]) &&
2943 cmd.argv[1] == newCmd.argv[1] &&
2944 cmd.argv[2] == newCmd.argv[2])
2945 {
2946 mCommands.erase(index); // Remove previous addTrigger command
2947 return false;
2948 }
2949 break;
2950
2951 case CmdAddSequence:
2952 if (namesEqual(cmd.argv[1], newCmd.argv[0]))
2953 return true; // Sequence is used as a source => cannot go back further
2954 break;
2955
2956 default:
2957 break;
2958 }
2959 }
2960
2961 return true;
2962}
2963
2964//-----------------------------------------------------------------------------
2965// MESH COMMANDS

Callers

nothing calls this directly

Calls 3

namesEqualFunction · 0.85
sizeMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected