예제 #1
0
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;
}
예제 #2
0
파일: Carrier.c 프로젝트: rcarmo/homeworld
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]);
    }
}
예제 #3
0
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;
    }
}