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

Method readOpcode

bwapi/BWScriptEmulator/Opcode.cpp:24–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24bool Opcode::readOpcode (aithread &thread)
25{
26 // Read the opcode
27 BYTE bOpcode = thread.read<BYTE>();
28
29 // Check if opcode is valid
30 if ( bOpcode >= AISCRIPT::Enum::LAST || !Opcode::opcodeList[bOpcode] )
31 {
32 Broodwar << Text::Red << "Invalid Script Opcode: " << bOpcode << std::endl;
33 return false;
34 }
35
36 // Call the opcode
37 bool success = Opcode::opcodeList[bOpcode]->execute(thread);
38
39 // If the opcode execution succeeded, then we don't want to retry the opcode
40 if ( success )
41 thread.noretry();
42 return success;
43}

Callers

nothing calls this directly

Calls 2

noretryMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected