/////////////////////////////////////////////////////////////////////
| 333 | |
| 334 | ////////////////////////////////////////////////////////////////////////// |
| 335 | int CScriptObjectGame::ForceEntitiesToSleep(IFunctionHandler *pH) |
| 336 | { |
| 337 | if (!m_pGame->IsDevModeEnable()) |
| 338 | return (pH->EndFunction()); |
| 339 | |
| 340 | IEntity *pLocal=m_pGame->GetMyPlayer(); |
| 341 | IEntityItPtr pEntities=m_pSystem->GetIEntitySystem()->GetEntityIterator(); |
| 342 | pEntities->MoveFirst(); |
| 343 | IEntity *pEnt=NULL; |
| 344 | while((pEnt=pEntities->Next())!=NULL) |
| 345 | { |
| 346 | //EntityClass *pClass=pECR->GetByClass(pEnt->GetEntityClassName()); |
| 347 | if (pEnt==pLocal) |
| 348 | continue; // do not put to sleep ourselves |
| 349 | |
| 350 | IAIObject *pAI=pEnt->GetAI(); |
| 351 | if (!pAI || (pAI->GetType()==AIOBJECT_PLAYER)) |
| 352 | continue; |
| 353 | |
| 354 | pAI->Event(AIEVENT_SLEEP,0); |
| 355 | pEnt->SetSleep(true); |
| 356 | |
| 357 | //Vec3 pos = pEnt->GetPos(); |
| 358 | //m_pSystem->GetILog()->Log("ENTITY class=%s/%d ent=%s/%d pos=(%.1f,%.1f,%.1f)", pClass->strClassName.c_str(), pClass->cTypeID, pEnt->GetName(), pEnt->GetId(), pos.x, pos.y, pos.z); |
| 359 | } |
| 360 | |
| 361 | return (pH->EndFunction()); |
| 362 | } |
| 363 | |
| 364 | ////////////////////////////////////////////////////////////////////////// |
| 365 | int CScriptObjectGame::__RespawnEntity(IFunctionHandler *pH) |
nothing calls this directly
no test coverage detected