MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / add

Method add

ogsr_engine/xrGame/danger_manager.cpp:222–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222void CDangerManager::add(const CVisibleObject& object)
223{
224 if (!object.m_enabled)
225 return;
226
227 const CEntityAlive* obj = smart_cast<const CEntityAlive*>(object.m_object);
228 if (obj && !obj->g_Alive() && (obj->killer_id() != ALife::_OBJECT_ID(-1)))
229 {
230 if (!on_before_add.empty())
231 {
232 luabind::functor<bool> funct;
233 if (ai().script_engine().functor(on_before_add.c_str(), funct))
234 if (!funct(m_object->lua_game_object(), object, obj->Position(), object.m_level_time, CDangerObject::eDangerTypeFreshEntityCorpse,
235 CDangerObject::eDangerPerceiveTypeVisual))
236 return;
237 }
238 add(CDangerObject(obj, obj->Position(), object.m_level_time, CDangerObject::eDangerTypeFreshEntityCorpse, CDangerObject::eDangerPerceiveTypeVisual));
239 return;
240 }
241}
242
243void CDangerManager::add(const CSoundObject& object)
244{

Callers

nothing calls this directly

Calls 15

addFunction · 0.85
fis_zeroFunction · 0.85
find_ifClass · 0.85
CFindPredicateClass · 0.85
g_AliveMethod · 0.80
killer_idMethod · 0.80
functorMethod · 0.80
lua_game_objectMethod · 0.80
PositionMethod · 0.80
CDangerObjectClass · 0.70
emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected