| 6 | IMPLEMENT(Random_Jump); |
| 7 | |
| 8 | bool 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 | } |
nothing calls this directly
no test coverage detected