getEmptyEntity: More fixes

This commit is contained in:
Tal Hayon
2022-01-01 02:13:05 +02:00
parent d141b5bfbf
commit 442206651d
+4 -3
View File
@@ -233,7 +233,7 @@ void EraseAllEntities() {
gUnk_03000000.unk[1].unk6 = 1;
}
extern Entity gUnk_030015A0[0x4848];
extern Entity gUnk_030015A0[0x48];
extern Entity gUnk_03003BE0;
NONMATCH("./asm/getEmptyEntity.s", Entity* GetEmptyEntity()) {
@@ -261,7 +261,7 @@ NONMATCH("./asm/getEmptyEntity.s", Entity* GetEmptyEntity()) {
ptr = &gPlayerEntity;
do {
if ((s32)ptr->prev < 0 && (ptr->flags & 0xc) && gUpdateContext.current_entity != ptr) {
if ((s32)ptr->prev < 0 && (ptr->flags & 0xc) && ptr != gUpdateContext.current_entity) {
ClearDeletedEntity(ptr);
return ptr;
}
@@ -276,7 +276,8 @@ NONMATCH("./asm/getEmptyEntity.s", Entity* GetEmptyEntity()) {
currentEnt = listPtr->first;
nextList = listPtr + 1;
while ((u32)currentEnt != (u32)listPtr) {
if (currentEnt->kind != MANAGER && (currentEnt->flags & 0x1c) < flags_ip &&
if (currentEnt->kind != MANAGER
&& flags_ip < (currentEnt->flags & 0x1c) &&
gUpdateContext.current_entity != currentEnt) {
flags_ip = currentEnt->flags & 0x1c;
rv = currentEnt;