| 1253 | } |
| 1254 | |
| 1255 | void PlayerController::changeRoutine(const std::string& routineName) |
| 1256 | { |
| 1257 | if (routineName.empty()) |
| 1258 | { |
| 1259 | setRoutineFunc(0); |
| 1260 | return; |
| 1261 | } |
| 1262 | |
| 1263 | // Build new name for the routine |
| 1264 | std::string namecomp = "RTN_" + routineName + "_" + std::to_string(getScriptInstance().id); |
| 1265 | |
| 1266 | if (m_World.getScriptEngine().hasSymbol(namecomp)) |
| 1267 | setRoutineFunc(m_World.getScriptEngine().getSymbolIndexByName(namecomp)); |
| 1268 | else |
| 1269 | LogWarn() << "Could not find routine " << namecomp << " on NPC: " << getScriptInstance().name[0]; |
| 1270 | } |
| 1271 | |
| 1272 | bool PlayerController::isNpcReady() |
| 1273 | { |
no test coverage detected