Fix checkpoint_collision_hack name mangling

This commit is contained in:
Steven Casper 2024-08-31 21:09:21 -04:00
parent ef0f32823b
commit 7454f5531c

View File

@ -202,13 +202,13 @@ void zEntSetup(zEnt* ent)
checkpoint_collision_hack(ent);
}
// Equivalent. Local static name mangling on model_id is unlike anything else seen in the project so far.
// It is reminiscent of namespace mangling. There is also a simple instruction swap involving setting the
// autogenerated init variable, which may be solved if this mangling thing is figured out.
void checkpoint_collision_hack(zEnt* ent)
// Equivalent
// This function needs to be declared inline to generate the correct mangled name for model_id
inline void checkpoint_collision_hack(zEnt* ent)
{
// instruction swap involving the guard for this static initializer.
// Might be due to the sda reloc access for model_id getting moved down
static U32 model_id = xStrHash("checkpoint_bind");
if (ent->asset->modelInfoID == model_id)
{
ent->bound.type = 0x2;