示例#1
0
/*
 * ObjectListDestroy:  Free memory associated with a list of object_nodes.
 *   Returns NULL.
 */
list_type ObjectListDestroy(list_type obj_list)
{
   list_type l;

   for (l = obj_list; l != NULL; l = l->next)
      ObjectDestroy((object_node *) l->data);

   list_destroy(obj_list);
   return NULL;
}
/**
 *  ClientReceivePlayerLogoffPacket tells the client that one of the
 *  players have left this group.  Remove all the associated information.
 *
 *  @param p_packet -- logoff packet
 *
 *<!-----------------------------------------------------------------------*/
T_void ClientReceivePlayerLogoffPacket(T_packetEitherShortOrLong *p_packet)
{
    T_logoffPacket *p_logoff ;
    T_3dObject *p_obj ;

    DebugRoutine("ClientReceivePlayerLogoffPacket") ;

    if ((ClientIsAttemptingLogout() == FALSE) &&
        (ClientIsActive() == TRUE))  {
        p_logoff = (T_logoffPacket *)p_packet->data ;

        /* Find the other player's object. */
        p_obj = ObjectFind(p_logoff->objectId) ;

        /* If we found it, remove and destroy it. */
        if (p_obj != NULL)  {
            ObjectRemove(p_obj) ;
            ObjectDestroy(p_obj) ;
        }
    }

    DebugEnd() ;
}
示例#3
0
/*
 * RoomObjectDestroy:  Free memory associated with a room object.  Returns NULL.
 */
room_contents_node *RoomObjectDestroy(room_contents_node *r)
{
   OverlayListDestroy(r->motion.overlays);
   ObjectDestroy(&r->obj);   
   return NULL;
}