MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / zEntDestructObj_Update

Function zEntDestructObj_Update

src/SB/Game/zEntDestructObj.cpp:241–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241void zEntDestructObj_Update(zEntDestructObj* ent, xScene* scene, F32 dt)
242{
243 s32 parEmitterCustomFlags;
244 xParEmitterCustomSettings emitterCustomSettings;
245 f32 fxTimer;
246 f32 respawnTimer;
247
248 xEntUpdate((xEnt*)ent, scene, dt);
249 if ((u32)ent->healthCnt > 1U)
250 {
251 ent->state = DOBJ_STATE_INIT;
252 }
253
254 if ((xParEmitter*)ent->fx_emitter != NULL)
255 {
256 fxTimer = ent->fx_timer;
257 if (fxTimer > 0.0f)
258 {
259 ent->fx_timer = fxTimer - dt;
260
261 parEmitterCustomFlags = 0x100;
262 emitterCustomSettings.custom_flags = parEmitterCustomFlags;
263
264 emitterCustomSettings.pos = *xEntGetCenter((xEnt*)ent);
265
266 xParEmitterEmitCustom(ent->fx_emitter, dt, &emitterCustomSettings);
267 }
268 }
269
270 respawnTimer = ent->respawn_timer;
271 if (respawnTimer)
272 {
273 ent->respawn_timer = respawnTimer - dt;
274 if (ent->respawn_timer < 0.0f)
275 {
276 zEntDestructObj_Reset(ent, globals.sceneCur);
277 }
278 }
279}
280
281void zEntDestructObj_Hit(zEntDestructObj* ent, unsigned int mask)
282{

Callers

nothing calls this directly

Calls 4

xEntUpdateFunction · 0.85
xEntGetCenterFunction · 0.85
zEntDestructObj_ResetFunction · 0.85
xParEmitterEmitCustomFunction · 0.50

Tested by

no test coverage detected