1
0
mirror of https://github.com/td512/re3.git synced 2026-03-02 00:59:00 +00:00

Pool fixes from master

This commit is contained in:
Sergeanur
2020-12-08 07:52:03 +02:00
parent 579efc05fc
commit f3e9c82432
9 changed files with 38 additions and 23 deletions

View File

@@ -1784,10 +1784,10 @@ INITSAVEBUF
handle = 0;
} else if (pBuilding->GetIsATreadable()) {
type = 1;
handle = CPools::GetTreadablePool()->GetJustIndex((CTreadable*)pBuilding) + 1;
handle = CPools::GetTreadablePool()->GetJustIndex_NoFreeAssert((CTreadable*)pBuilding) + 1;
} else {
type = 2;
handle = CPools::GetBuildingPool()->GetJustIndex(pBuilding) + 1;
handle = CPools::GetBuildingPool()->GetJustIndex_NoFreeAssert(pBuilding) + 1;
}
WriteSaveBuf(buf, type);
WriteSaveBuf(buf, handle);
@@ -1805,19 +1805,19 @@ INITSAVEBUF
case ENTITY_TYPE_BUILDING:
if (((CBuilding*)pEntity)->GetIsATreadable()) {
type = 1;
handle = CPools::GetTreadablePool()->GetJustIndex((CTreadable*)pEntity) + 1;
handle = CPools::GetTreadablePool()->GetJustIndex_NoFreeAssert((CTreadable*)pEntity) + 1;
} else {
type = 2;
handle = CPools::GetBuildingPool()->GetJustIndex((CBuilding*)pEntity) + 1;
handle = CPools::GetBuildingPool()->GetJustIndex_NoFreeAssert((CBuilding*)pEntity) + 1;
}
break;
case ENTITY_TYPE_OBJECT:
type = 3;
handle = CPools::GetObjectPool()->GetJustIndex((CObject*)pEntity) + 1;
handle = CPools::GetObjectPool()->GetJustIndex_NoFreeAssert((CObject*)pEntity) + 1;
break;
case ENTITY_TYPE_DUMMY:
type = 4;
handle = CPools::GetDummyPool()->GetJustIndex((CDummy*)pEntity) + 1;
handle = CPools::GetDummyPool()->GetJustIndex_NoFreeAssert((CDummy*)pEntity) + 1;
default: break;
}
}