MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / changeRoutine

Method changeRoutine

src/logic/PlayerController.cpp:1255–1270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1253}
1254
1255void 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
1272bool PlayerController::isNpcReady()
1273{

Callers 1

Calls 3

hasSymbolMethod · 0.80
getSymbolIndexByNameMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected