| 244 | } |
| 245 | |
| 246 | void ScriptEngine::onNPCInitialized(Daedalus::GameState::NpcHandle npc) |
| 247 | { |
| 248 | // Initialize daily routine |
| 249 | Daedalus::GEngineClasses::C_Npc& npcData = getGameState().getNpc(npc); |
| 250 | |
| 251 | //LogInfo() << "Initializing daily routine for: " << npcData.name[0] << ", hdl: " << npc.index; |
| 252 | //LogInfo() << "Self: " << getSymbolIndexByName("self"); |
| 253 | |
| 254 | if (npcData.daily_routine != 0) |
| 255 | { |
| 256 | prepareRunFunction(); |
| 257 | |
| 258 | m_pVM->setInstance("self", ZMemory::toBigHandle(npc), Daedalus::IC_Npc); |
| 259 | m_pVM->setCurrentInstance(getSymbolIndexByName("self")); |
| 260 | |
| 261 | runFunctionBySymIndex(npcData.daily_routine); |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | std::set<Handle::EntityHandle> ScriptEngine::getNPCsInRadius(const Math::float3& center, float radius) |
| 266 | { |
nothing calls this directly
no test coverage detected