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

Function checkpoint_collision_hack

src/SB/Game/zEnt.cpp:209–240  ·  view source on GitHub ↗

Equivalent This function needs to be declared inline to generate the correct mangled name for model_id

Source from the content-addressed store, hash-verified

207// Equivalent
208// This function needs to be declared inline to generate the correct mangled name for model_id
209inline void checkpoint_collision_hack(zEnt* ent)
210{
211 // instruction swap involving the guard for this static initializer.
212 // Might be due to the sda reloc access for model_id getting moved down
213 static U32 model_id = xStrHash("checkpoint_bind");
214 if (ent->asset->modelInfoID == model_id)
215 {
216 ent->bound.type = 0x2;
217 xVec3* lower = &ent->bound.box.box.lower;
218 xVec3* upper = &ent->bound.box.box.upper;
219 *lower = *upper = xEntGetFrame(ent)->pos;
220
221 lower->x += -0.5f;
222 lower->z += -0.5f;
223
224 upper->x += 0.5f;
225 upper->y += 5.0f;
226 upper->z += 0.5f;
227
228 xEntDefaultBoundUpdate(ent, &xEntGetFrame(ent)->pos);
229
230 ent->miscflags = ent->miscflags | 8;
231
232 xEntAnimateCollision(*ent, 0);
233 xModelAnimCollStop(*(ent->collModel != NULL ? ent->collModel : ent->model));
234
235 ent->moreFlags = ent->moreFlags & 0xdd;
236 ent->asset->moreFlags = ent->asset->moreFlags & 0xdd;
237 ent->baseFlags = ent->baseFlags & 0xffef;
238 ent->asset->baseFlags = ent->asset->baseFlags & 0xffef;
239 }
240}
241
242void zEntSave(zEnt* ent, xSerial* s)
243{

Callers 2

zEntSetupFunction · 0.85
zEntResetFunction · 0.85

Calls 5

xEntGetFrameFunction · 0.85
xEntAnimateCollisionFunction · 0.85
xModelAnimCollStopFunction · 0.85
xStrHashFunction · 0.50
xEntDefaultBoundUpdateFunction · 0.50

Tested by

no test coverage detected