ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/plugins/cfanim/cfanim.c
(Generate patch)

Comparing deliantra/server/plugins/cfanim/cfanim.c (file contents):
Revision 1.2 by root, Thu Feb 9 02:29:31 2006 UTC vs.
Revision 1.5 by elmex, Sat Jul 15 11:57:02 2006 UTC

22/* GNU General Public License for more details. */ 22/* GNU General Public License for more details. */
23/* */ 23/* */
24/* You should have received a copy of the GNU General Public License */ 24/* You should have received a copy of the GNU General Public License */
25/* along with this program; if not, write to the Free Software */ 25/* along with this program; if not, write to the Free Software */
26/* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ 26/* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
27/* */ /*****************************************************************************/ 27/* */
28/*****************************************************************************/
28 29
29/* First let's include the header file needed */ 30/* First let's include the header file needed */
30 31
31#include <cfanim.h> 32#include <cfanim.h>
32#include <stdarg.h> 33#include <stdarg.h>
436{ 437{
437 qsort (animationbox,animationcount,sizeof (CFanimationHook),compareAnims); 438 qsort (animationbox,animationcount,sizeof (CFanimationHook),compareAnims);
438 ordered_commands=1; 439 ordered_commands=1;
439} 440}
440 441
441CFanimationHook* get_command (char* command) 442static CFanimationHook *get_command(char *command)
442{ 443{
443 CFanimationHook dummy; 444 CFanimationHook dummy;
444 dummy.name=command; 445 dummy.name=command;
445 if (!ordered_commands) 446 if (!ordered_commands)
446 prepare_commands(); 447 prepare_commands();
447 return (CFanimationHook*) 448 return (CFanimationHook*)
448 bsearch (&dummy,animationbox,animationcount, 449 bsearch (&dummy,animationbox,animationcount,
449 sizeof(CFanimationHook), compareAnims); 450 sizeof(CFanimationHook), compareAnims);
450} 451}
451 452
452CFmovement* parse_animation_block (char* buffer, size_t buffer_size,FILE* fichier, CFanimation* parent) 453static CFmovement *parse_animation_block(char *buffer, size_t buffer_size, FILE *fichier, CFanimation *parent)
453{ 454{
454 CFmovement* first=NULL; 455 CFmovement* first=NULL;
455 CFmovement* current=NULL; 456 CFmovement* current=NULL;
456 CFmovement* next; 457 CFmovement* next;
457 char* time; 458 char* time;
589} 590}
590 591
591/* 592/*
592 * return a new animation pointer inserted in the list of animations 593 * return a new animation pointer inserted in the list of animations
593 */ 594 */
594CFanimation* create_animation(void) 595static CFanimation *create_animation(void)
595{ 596{
596 CFanimation* new; 597 CFanimation* new;
597 CFanimation* current; 598 CFanimation* current;
598 new=(CFanimation*) malloc (sizeof (CFanimation)); 599 new=(CFanimation*) malloc (sizeof (CFanimation));
599 if (!new) return NULL; 600 if (!new) return NULL;
830 if (current_anim->nextmovement) break; 831 if (current_anim->nextmovement) break;
831 } 832 }
832 fclose (fichier); 833 fclose (fichier);
833 return 1; 834 return 1;
834} 835}
835void animate_one(CFanimation* animation, long int milliseconds) 836static void animate_one(CFanimation *animation, long int milliseconds)
836{ 837{
837 CFmovement* current; 838 CFmovement* current;
838 839
839 if (animation->time_representation==time_second) 840 if (animation->time_representation==time_second)
840 animation->tick_left+=milliseconds; 841 animation->tick_left+=milliseconds;
1084 if (buf !=0) 1085 if (buf !=0)
1085 strcpy(context->message,buf); 1086 strcpy(context->message,buf);
1086 break; 1087 break;
1087 case EVENT_TELL: 1088 case EVENT_TELL:
1088 break; 1089 break;
1090 case EVENT_FIND_UNARMED_SKILL:
1091 context->who = va_arg(args, object*);
1092 break;
1093 case EVENT_PLAYER_USE_SKILL:
1094 case EVENT_MONSTER_USE_SKILL:
1095 context->activator = va_arg(args, object*);
1096 context->who = va_arg(args, object*);
1097 context->third = va_arg(args, object*);
1098 context->fix = va_arg(args, int);
1099
1100 buf = va_arg(args, char*);
1101 if (buf !=0)
1102 strncpy(context->message, buf, sizeof (context->message));
1103 break;
1089 } 1104 }
1090 va_end(args); 1105 va_end(args);
1091 context->returnvalue = 0; 1106 context->returnvalue = 0;
1092 1107
1093 pushContext(context); 1108 pushContext(context);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines