version 1.3 | | version 1.4 |
---|
| | |
long int initsay (char* name, char* parameters, struct CFmovement_struct* move_entity) | | long int initsay (char* name, char* parameters, struct CFmovement_struct* move_entity) |
{ | | { |
if (parameters) | | if (parameters) |
move_entity->parameters=strdup_local (parameters); | | move_entity->parameters=cf_strdup_local (parameters); |
else | | else |
move_entity->parameters=NULL; | | move_entity->parameters=NULL; |
printf ("CFAnim: init say: parameters: %p\n",parameters); | | printf ("CFAnim: init say: parameters: %p\n",parameters); |
| | |
| | |
long int initdropobject (char* name, char* parameters, struct CFmovement_struct* move_entity) | | long int initdropobject (char* name, char* parameters, struct CFmovement_struct* move_entity) |
{ | | { |
move_entity->parameters=parameters?strdup_local(parameters):NULL; | | move_entity->parameters=parameters?cf_strdup_local(parameters):NULL; |
return 1; | | return 1; |
} | | } |
int rundropobject(struct CFanimation_struct* animation, long int id, void* parameters) | | int rundropobject(struct CFanimation_struct* animation, long int id, void* parameters) |
| | |
if (mapname[0]=='\0') | | if (mapname[0]=='\0') |
return 0; | | return 0; |
teleport=(teleport_params*)malloc (sizeof(teleport_params)); | | teleport=(teleport_params*)malloc (sizeof(teleport_params)); |
teleport->mapname=strdup_local (mapname); | | teleport->mapname=cf_strdup_local (mapname); |
teleport->mapx=mapx; | | teleport->mapx=mapx; |
teleport->mapy=mapy; | | teleport->mapy=mapy; |
move_entity->parameters=teleport; | | move_entity->parameters=teleport; |
| | |
| | |
long int initnotice (char* name, char* parameters, struct CFmovement_struct* move_entity) | | long int initnotice (char* name, char* parameters, struct CFmovement_struct* move_entity) |
{ | | { |
move_entity->parameters=parameters?strdup_local(parameters):NULL; | | move_entity->parameters=parameters?cf_strdup_local(parameters):NULL; |
return 1; | | return 1; |
} | | } |
int runnotice(struct CFanimation_struct* animation, long int id, void* parameters) | | int runnotice(struct CFanimation_struct* animation, long int id, void* parameters) |
| | |
int errors_found=0; | | int errors_found=0; |
CFanimation* current_anim; | | CFanimation* current_anim; |
| | |
fichier = fopen(create_pathname(file),"r"); | | fichier = fopen(cf_get_maps_directory(file),"r"); |
if (fichier == NULL) | | if (fichier == NULL) |
{ | | { |
printf("CFAnim: Unable to open %s\n", create_pathname(file)); | | printf("CFAnim: Unable to open %s\n", cf_get_maps_directory(file)); |
return 0; | | return 0; |
} | | } |
while (fgets(buffer,HUGE_BUF,fichier)) | | while (fgets(buffer,HUGE_BUF,fichier)) |
| | |
{ | | { |
if (*value=='"') value++; | | if (*value=='"') value++; |
if (value[strlen(value)-1] == '"') value[strlen(value)-1]='\0'; | | if (value[strlen(value)-1] == '"') value[strlen(value)-1]='\0'; |
name=strdup_local (value); | | name=cf_strdup_local (value); |
} | | } |
else if (!strcmp (variable,"victimtype")) | | else if (!strcmp (variable,"victimtype")) |
{ | | { |
| | |
} | | } |
else if (!strcmp(variable,"animation")) | | else if (!strcmp(variable,"animation")) |
{ | | { |
animationitem=strdup_local(value); | | animationitem=cf_strdup_local(value); |
} | | } |
else errors_found=1; | | else errors_found=1; |
} | | } |
} | | } |
if (buffer[0]=='\0') | | if (buffer[0]=='\0') |
{ | | { |
printf ("CFAnim: Errors occurred during the parsing of %s\n", create_pathname(file)); | | printf ("CFAnim: Errors occurred during the parsing of %s\n", cf_get_maps_directory(file)); |
return 0; | | return 0; |
} | | } |
if (!(current_anim=create_animation())) | | if (!(current_anim=create_animation())) |