MCPcopy Create free account
hub / github.com/bwapi/bwapi / execute

Method execute

bwapi/BWScriptEmulator/Random_Jump.cpp:8–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6IMPLEMENT(Random_Jump);
7
8bool Random_Jump::execute(aithread &thread) const
9{
10 // Retrieve parameters
11 BYTE bChance;
12 WORD wOffset;
13 thread.readTuple( std::tie(bChance, wOffset) );
14
15 /// Set the new script offset
16 if ( (BYTE)rand() <= bChance )
17 thread.setScriptOffset( wOffset );
18
19 // Save debug info and return
20 thread.saveDebug(Text::Green, this->getOpcode(), "%u p_%04X", bChance, wOffset);
21 return true;
22}

Callers

nothing calls this directly

Calls 4

setScriptOffsetMethod · 0.80
saveDebugMethod · 0.80
getOpcodeMethod · 0.80
readTupleMethod · 0.45

Tested by

no test coverage detected