ping *LoadAndFixAnomalyPing(void) { SaveChunk *chunk; ping *newping; sdword size; chunk = LoadNextChunk(); VerifyChunkNoSize(chunk,VARIABLE_STRUCTURE|SAVE_PING); size = sizeofping(((ping *)chunkContents(chunk))); dbgAssert(size == chunk->contentsSize); newping = memAlloc(size,"Ping!",0); memcpy(newping,chunkContents(chunk),size); memFree(chunk); newping->owner = SpaceObjRegistryGetObj((sdword)newping->owner); newping->userID = (sdword)SpaceObjRegistryGetObj((sdword)newping->userID); newping->evaluate = pingAnomalyPingTimeout; if (newping->userDataSize > 0) { SelectAnyCommand *tempsel = (SelectAnyCommand *)LoadSelectionAndFix(); memcpy((newping + 1),tempsel,sizeofSelectCommand(tempsel->numTargets)); memFree(tempsel); } return newping; }
void Carrier_Fix(Ship *ship) { CarrierSpec *spec = (CarrierSpec *)ship->ShipSpecifics; sdword i; for(i=0;i<MAX_NUM_DROP;i++) { spec->droptarget[i] = (SpaceObjRotImpTargGuidanceShipDerelict *)SpaceObjRegistryGetObj((sdword)spec->droptarget[i]); } }
void CloakGenerator_Fix(Ship *ship) { CloakGeneratorSpec *spec = (CloakGeneratorSpec *)ship->ShipSpecifics; Node *node = spec->CloakList.head; CloakStruct *cloakStruct; while (node != NULL) { cloakStruct = (CloakStruct *)listGetStructOfNode(node); cloakStruct->spaceobj = SpaceObjRegistryGetObj((sdword)cloakStruct->spaceobj); node = node->next; } }