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

Method execute

bwapi/BWScriptEmulator/Prep_Down.cpp:8–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6IMPLEMENT(Prep_Down);
7
8bool Prep_Down::execute(aithread &thread) const
9{
10 // Retrieve parameters
11 BYTE bSaveCount, bMinCount;
12 WORD wUnitType;
13 thread.readTuple( std::tie(bSaveCount, bMinCount, wUnitType) );
14
15 // Get count
16 int count = GetStandardUnitCount(wUnitType, false) - bSaveCount;
17 if ( count < bMinCount )
18 count = bMinCount;
19
20 // Add to attack group
21 // AI_AttackAdd(count, wUnitType);
22
23 // Save debug info and return
24 thread.saveDebug(Text::Red, this->getOpcode(), "%u %u %s", bSaveCount, bMinCount, AISCRIPT::getUnitName(wUnitType));
25 return true;
26}

Callers

nothing calls this directly

Calls 5

GetStandardUnitCountFunction · 0.85
getUnitNameFunction · 0.85
saveDebugMethod · 0.80
getOpcodeMethod · 0.80
readTupleMethod · 0.45

Tested by

no test coverage detected