/* ************************************************************************** */
/*                                                          LE - /            */
/*                                                              /             */
/*   ft_get_sprite.c                                  .::    .:/ .      .::   */
/*                                                 +:+:+   +:    +:  +:+:+    */
/*   By: rbousset <marvin@le-101.fr>                +:+   +:    +:    +:+     */
/*                                                 #+#   #+    #+    #+#      */
/*   Created: 2020/02/02 17:19:27 by rbousset     #+#   ##    ##    #+#       */
/*   Updated: 2020/02/02 17:19:27 by rbousset    ###    #+. /#+    ###.fr     */
/*                                                         /                  */
/*                                                        /                   */
/* ************************************************************************** */

#include <libft.h>
#include <cub3d.h>

int
	ft_get_sprite(char **words, t_cub *clist)
{
	if (!(*words) || !words[1] || words[2])
		return (-1);
	ft_memdel((void**)&clist->sprite_path);
	if (!(clist->sprite_path = ft_strdup(*(words + 1))))
		return (-1);
	return (0);
}