Zero out structures when creating houses and rooms

This commit is contained in:
elasota
2021-05-11 19:47:05 -04:00
parent e7b02f37a5
commit 95260f8d8a
3 changed files with 5 additions and 0 deletions

View File

@@ -224,6 +224,7 @@ Boolean InitializeEmptyHouse (void)
}
thisHousePtr = *thisHouse;
memset(thisHousePtr, 0, houseSizeNoRooms);
thisHousePtr->version = kHouseVersion;
thisHousePtr->firstRoom = -1;

View File

@@ -172,6 +172,8 @@ Boolean CreateNewRoom (short h, short v)
CopyThisRoomToRoom(); // save off current room
memset(thisRoom, 0, sizeof(roomType));
PasStringCopy(PSTR("Untitled Room"), thisRoom->name);
thisRoom->leftStart = 32; // fill out fields of new room
thisRoom->rightStart = 32;

View File

@@ -183,6 +183,8 @@ void CreatePointers (void)
if (thisRoom == nil)
RedAlert(kErrNoMemory);
memset(thisRoom, 0, sizeof(roomType));
hotSpots = nil;
hotSpots = (hotPtr)NewPtr(sizeof(hotObject) * kMaxHotSpots);
if (hotSpots == nil)