void SaveCloakStruct(CloakStruct *cloakStruct) { SaveChunk *chunk; CloakStruct *savecontents; chunk = CreateChunk(BASIC_STRUCTURE,sizeof(CloakStruct),cloakStruct); savecontents = (CloakStruct *)chunkContents(chunk); savecontents->spaceobj = (SpaceObj *)SpaceObjRegistryGetID(savecontents->spaceobj); SaveThisChunk(chunk); memFree(chunk); }
void SaveDefenseStruct(DefenseStruct *defenseStruct) { SaveChunk *chunk; DefenseStruct *savecontents; chunk = CreateChunk(BASIC_STRUCTURE,sizeof(DefenseStruct),defenseStruct); savecontents = (DefenseStruct *)chunkContents(chunk); savecontents->bullet = (Bullet *) SpaceObjRegistryGetID((SpaceObj *)savecontents->bullet); savecontents->laser = (Bullet *) SpaceObjRegistryGetID((SpaceObj *)savecontents->laser); SaveThisChunk(chunk); memFree(chunk); }
void SaveAnomalyPing(ping *tping) { SaveChunk *chunk; sdword size = sizeofping(tping); ping *savecontents; chunk = CreateChunk(VARIABLE_STRUCTURE|SAVE_PING,size,tping); savecontents = (ping *)chunkContents(chunk); savecontents->owner = (SpaceObj *)SpaceObjRegistryGetID(tping->owner); savecontents->userID = SpaceObjRegistryGetID((SpaceObj *)tping->userID); SaveThisChunk(chunk); memFree(chunk); if (tping->userDataSize > 0) { SaveSelection((SpaceObjSelection *) (tping + 1)); } }