void ResearchShip_PreFix(Ship *ship) { ResearchShipSpec *spec = (ResearchShipSpec *)ship->ShipSpecifics; spec->masterptr = (Ship *)SpaceObjRegistryGetID((SpaceObj *)spec->masterptr); spec->dockwith = (Ship *)SpaceObjRegistryGetID((SpaceObj *)spec->dockwith); }
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 Carrier_PreFix(Ship *ship) { CarrierSpec *spec = (CarrierSpec *)ship->ShipSpecifics; sdword i; for(i=0;i<MAX_NUM_DROP;i++) { spec->droptarget[i] = (SpaceObjRotImpTargGuidanceShipDerelict*)SpaceObjRegistryGetID((SpaceObj *)spec->droptarget[i]); } }
void DDDFrigate_PreFix(Ship *ship) { sdword i; DDDFrigateSpec *spec = (DDDFrigateSpec *)ship->ShipSpecifics; for (i=0;i<MAX_NUM_DRONES;i++) { spec->DronePtrs[i] = SpaceObjRegistryGetID((SpaceObj *)spec->DronePtrs[i]); } }
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)); } }
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 RepairCorvette_PreFix(Ship *ship) { RepairCorvetteSpec *spec = (RepairCorvetteSpec *)ship->ShipSpecifics; spec->target = (Ship *) SpaceObjRegistryGetID((SpaceObj *)spec->target); }