mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 03:59:36 +00:00
Zero out structures when creating houses and rooms
This commit is contained in:
@@ -224,6 +224,7 @@ Boolean InitializeEmptyHouse (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
thisHousePtr = *thisHouse;
|
thisHousePtr = *thisHouse;
|
||||||
|
memset(thisHousePtr, 0, houseSizeNoRooms);
|
||||||
|
|
||||||
thisHousePtr->version = kHouseVersion;
|
thisHousePtr->version = kHouseVersion;
|
||||||
thisHousePtr->firstRoom = -1;
|
thisHousePtr->firstRoom = -1;
|
||||||
|
|||||||
@@ -171,6 +171,8 @@ Boolean CreateNewRoom (short h, short v)
|
|||||||
char wasState;
|
char wasState;
|
||||||
|
|
||||||
CopyThisRoomToRoom(); // save off current room
|
CopyThisRoomToRoom(); // save off current room
|
||||||
|
|
||||||
|
memset(thisRoom, 0, sizeof(roomType));
|
||||||
|
|
||||||
PasStringCopy(PSTR("Untitled Room"), thisRoom->name);
|
PasStringCopy(PSTR("Untitled Room"), thisRoom->name);
|
||||||
thisRoom->leftStart = 32; // fill out fields of new room
|
thisRoom->leftStart = 32; // fill out fields of new room
|
||||||
|
|||||||
@@ -182,6 +182,8 @@ void CreatePointers (void)
|
|||||||
thisRoom = (roomPtr)NewPtr(sizeof(roomType));
|
thisRoom = (roomPtr)NewPtr(sizeof(roomType));
|
||||||
if (thisRoom == nil)
|
if (thisRoom == nil)
|
||||||
RedAlert(kErrNoMemory);
|
RedAlert(kErrNoMemory);
|
||||||
|
|
||||||
|
memset(thisRoom, 0, sizeof(roomType));
|
||||||
|
|
||||||
hotSpots = nil;
|
hotSpots = nil;
|
||||||
hotSpots = (hotPtr)NewPtr(sizeof(hotObject) * kMaxHotSpots);
|
hotSpots = (hotPtr)NewPtr(sizeof(hotObject) * kMaxHotSpots);
|
||||||
|
|||||||
Reference in New Issue
Block a user