small garages revision + small template stuff

This commit is contained in:
Nikolay Korolev
2020-11-30 02:15:03 +03:00
parent c57fee38ca
commit 8f05ccd6c4
9 changed files with 139 additions and 112 deletions

View File

@ -1604,10 +1604,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);
@ -1625,19 +1625,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;
}
}