mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-13 19:49:36 +00:00
Fix room count mismatch
This commit is contained in:
@@ -117,7 +117,7 @@ Boolean CreateNewHouse (void)
|
|||||||
theSpec.m_name[0] = static_cast<uint8_t>(savePathLength);
|
theSpec.m_name[0] = static_cast<uint8_t>(savePathLength);
|
||||||
memcpy(theSpec.m_name + 1, savePath, savePathLength);
|
memcpy(theSpec.m_name + 1, savePath, savePathLength);
|
||||||
|
|
||||||
// Don't try to overwrite the current house - The GPF will probably be locked anyway
|
// Don't try to overwrite the current house
|
||||||
if (houseCFile && theSpec.m_dir == houseCFile->GetDirectory() && !StrCmp::CompareCaseInsensitive(theSpec.m_name, houseCFile->GetFileName()))
|
if (houseCFile && theSpec.m_dir == houseCFile->GetDirectory() && !StrCmp::CompareCaseInsensitive(theSpec.m_name, houseCFile->GetFileName()))
|
||||||
{
|
{
|
||||||
CheckFileError(PLErrors::kFileIsBusy, theSpec.m_name);
|
CheckFileError(PLErrors::kFileIsBusy, theSpec.m_name);
|
||||||
@@ -173,7 +173,7 @@ Boolean InitializeEmptyHouse (void)
|
|||||||
if (thisHouse != nil)
|
if (thisHouse != nil)
|
||||||
thisHouse.Dispose();
|
thisHouse.Dispose();
|
||||||
|
|
||||||
thisHouse = NewHandle(sizeof(houseType)).StaticCast<houseType>();
|
thisHouse = NewHandle(sizeof(houseType) - sizeof(roomType)).StaticCast<houseType>();
|
||||||
|
|
||||||
if (thisHouse == nil)
|
if (thisHouse == nil)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -616,7 +616,7 @@ void ValidateNumberOfRooms (void)
|
|||||||
|
|
||||||
reportsRooms = (long)(*thisHouse)->nRooms;
|
reportsRooms = (long)(*thisHouse)->nRooms;
|
||||||
countedRooms = (GetHandleSize(thisHouse.StaticCast<void>()) -
|
countedRooms = (GetHandleSize(thisHouse.StaticCast<void>()) -
|
||||||
sizeof(houseType)) / sizeof(roomType);
|
sizeof(houseType)) / sizeof(roomType) + 1;
|
||||||
if (reportsRooms != countedRooms)
|
if (reportsRooms != countedRooms)
|
||||||
{
|
{
|
||||||
(*thisHouse)->nRooms = (short)countedRooms;
|
(*thisHouse)->nRooms = (short)countedRooms;
|
||||||
|
|||||||
Reference in New Issue
Block a user