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

Method execute

bwapi/BWScriptEmulator/Debug.cpp:9–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7Debug fatal_error_impl(AISCRIPT::Enum::FATAL_ERROR);
8
9bool Debug::execute(aithread &thread) const
10{
11 // Perform independant behaviours
12 if ( this->getOpcode() == AISCRIPT::Enum::FATAL_ERROR )
13 {
14 // Message
15 Broodwar->sendText("Illegal AI script executed.");
16
17 // Debug
18 thread.saveDebug(Text::Green, this->getOpcode());
19
20 // Kill the script
21 thread.killThread();
22 thread.noretry();
23 return false;
24 }
25 else if ( this->getOpcode() == AISCRIPT::Enum::DEBUG )
26 {
27 // Read parameters
28 WORD wJump;
29 thread.readTuple( std::tie( wJump) );
30
31 // Send the message
32 Broodwar->sendText("%s", &pbAIScriptBinary[thread.getScriptOffset()] );
33
34 // Jump to offset
35 thread.setScriptOffset(wJump);
36 thread.saveDebug(Text::Green, this->getOpcode(), "p_%X %s", wJump, &pbAIScriptBinary[thread.getScriptOffset()]);
37 }
38 return true;
39}

Callers

nothing calls this directly

Calls 8

getOpcodeMethod · 0.80
sendTextMethod · 0.80
saveDebugMethod · 0.80
killThreadMethod · 0.80
noretryMethod · 0.80
getScriptOffsetMethod · 0.80
setScriptOffsetMethod · 0.80
readTupleMethod · 0.45

Tested by

no test coverage detected