|
From: <cro...@li...> - 2003-03-19 08:04:54
|
Module Name: crossfire
Committed By: mwedel
Date: Wed Mar 19 08:04:52 UTC 2003
Modified Files:
crossfire: ChangeLog
crossfire/common: anim.c
crossfire/crossedit: Attr.c
crossfire/include: libproto.h newserver.h
crossfire/plugin_animator: animator_box.c
crossfire/server: move.c player.c spell_effect.c
crossfire/socket: init.c request.c
Log Message:
common/anim.c: Pass direction to animate_object() - needed for player
animations as player's facing may not match direction.
crossedit/Attr.c, server/main.c, server/time.c: Update calls to animate_object()
include/libproto.h: rebuilt
include/newserver.h, plugin_animator/animator_box.c, socket/init.c,
socket/request.c: Remove newanim field from socket structure - not needed -
how to animate is determined by object, not by socket.
server/move.c: Add check to P_OUT_OF_MAP in teleport function.
server/player.c: change move_player to call animate_object, so it gets full
power of functionality it supports instead of 4 way hardcode animation
information.
server/spell_effect.c: When altars are consecrated, don't look to arch name
for first portion of name - always call them Altar of %s - fixes problem
where altar is special god altar that has god's name in archetype, resulting
in altar of .. of ...
MSW 2003-03-18
Start of context diffs
Index: crossfire/ChangeLog
diff -c crossfire/ChangeLog:1.54 crossfire/ChangeLog:1.55
*** crossfire/ChangeLog:1.54 Fri Mar 7 21:35:31 2003
--- crossfire/ChangeLog Wed Mar 19 00:04:50 2003
***************
*** 17,22 ****
--- 17,39 ----
------------------------------------------------------------------------------
Changes for CVS:
+ common/anim.c: Pass direction to animate_object() - needed for player
+ animations as player's facing may not match direction.
+ crossedit/Attr.c, server/main.c, server/time.c: Update calls to animate_object()
+ include/libproto.h: rebuilt
+ include/newserver.h, plugin_animator/animator_box.c, socket/init.c,
+ socket/request.c: Remove newanim field from socket structure - not needed -
+ how to animate is determined by object, not by socket.
+ server/move.c: Add check to P_OUT_OF_MAP in teleport function.
+ server/player.c: change move_player to call animate_object, so it gets full
+ power of functionality it supports instead of 4 way hardcode animation
+ information.
+ server/spell_effect.c: When altars are consecrated, don't look to arch name
+ for first portion of name - always call them Altar of %s - fixes problem
+ where altar is special god altar that has god's name in archetype, resulting
+ in altar of .. of ...
+ MSW 2003-03-18
+
Patch for 64 bit experience total, as well as flexible number of levels.
Basically, max level is now dynamic, set in exp_table file. Experience
is now a 64 bit value, so much higher totals now allowed. To
Index: crossfire/common/anim.c
diff -c crossfire/common/anim.c:1.13 crossfire/common/anim.c:1.14
*** crossfire/common/anim.c:1.13 Sun Feb 23 23:38:38 2003
--- crossfire/common/anim.c Wed Mar 19 00:04:48 2003
***************
*** 1,6 ****
/*
* static char *rcsid_anim_c =
! * "$Id: anim.c,v 1.13 2003/02/24 07:38:38 mwedel Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_anim_c =
! * "$Id: anim.c,v 1.14 2003/03/19 08:04:48 mwedel Exp $";
*/
/*
***************
*** 143,154 ****
/*
* animate_object(object) updates the face-variable of an object.
* If the object is the head of a multi-object, all objects are animated.
*/
! void animate_object(object *op) {
int max_state; /* Max animation state object should be drawn in */
int base_state; /* starting index # to draw from */
- int dir=op->direction;
if(!op->animation_id || !NUM_ANIMATIONS(op)) {
LOG(llevError,"Object lacks animation.\n");
--- 143,158 ----
/*
* animate_object(object) updates the face-variable of an object.
* If the object is the head of a multi-object, all objects are animated.
+ * op is the object to animate.
+ * dir is the direction the object is facing. This is generally same as
+ * op->direction, but in some cases, op->facing is used instead - the
+ * caller has a better idea which one it really wants to be using,
+ * so let it pass along the right one.
*/
! void animate_object(object *op, int dir) {
int max_state; /* Max animation state object should be drawn in */
int base_state; /* starting index # to draw from */
if(!op->animation_id || !NUM_ANIMATIONS(op)) {
LOG(llevError,"Object lacks animation.\n");
***************
*** 203,209 ****
}
#endif
if(op->more)
! animate_object(op->more);
/* update_object will also recursively update all the pieces.
* as such, we call it last, and only call it for the head
--- 207,213 ----
}
#endif
if(op->more)
! animate_object(op->more, dir);
/* update_object will also recursively update all the pieces.
* as such, we call it last, and only call it for the head
Index: crossfire/crossedit/Attr.c
diff -c crossfire/crossedit/Attr.c:1.16 crossfire/crossedit/Attr.c:1.17
*** crossfire/crossedit/Attr.c:1.16 Thu Mar 6 23:33:13 2003
--- crossfire/crossedit/Attr.c Wed Mar 19 00:04:50 2003
***************
*** 316,328 ****
/*** direction ***/
static void putDirection (object *ob, char *str, XtPointer c) {
ob->stats.maxsp = atoi(str);
! animate_object (ob);
}
/*** rotation ***/
static void putRotation (object *ob, char *str, XtPointer c) {
ob->stats.sp = atoi(str);
! animate_object (ob);
}
/*** unique ***/
--- 316,328 ----
/*** direction ***/
static void putDirection (object *ob, char *str, XtPointer c) {
ob->stats.maxsp = atoi(str);
! animate_object (ob, ob->direction);
}
/*** rotation ***/
static void putRotation (object *ob, char *str, XtPointer c) {
ob->stats.sp = atoi(str);
! animate_object (ob, ob->direction);
}
/*** unique ***/
Index: crossfire/include/libproto.h
diff -c crossfire/include/libproto.h:1.41 crossfire/include/libproto.h:1.42
*** crossfire/include/libproto.h:1.41 Fri Mar 7 21:35:32 2003
--- crossfire/include/libproto.h Wed Mar 19 00:04:50 2003
***************
*** 2,8 ****
extern void free_all_anim(void);
extern void init_anim(void);
extern int find_animation(char *name);
! extern void animate_object(object *op);
/* arch.c */
extern archetype *find_archetype_by_object_name(char *name);
extern object *get_archetype_by_object_name(char *name);
--- 2,8 ----
extern void free_all_anim(void);
extern void init_anim(void);
extern int find_animation(char *name);
! extern void animate_object(object *op, int dir);
/* arch.c */
extern archetype *find_archetype_by_object_name(char *name);
extern object *get_archetype_by_object_name(char *name);
Index: crossfire/include/newserver.h
diff -c crossfire/include/newserver.h:1.26 crossfire/include/newserver.h:1.27
*** crossfire/include/newserver.h:1.26 Sun Jul 14 21:57:12 2002
--- crossfire/include/newserver.h Wed Mar 19 00:04:50 2003
***************
*** 1,6 ****
/*
* static char *rcsid_newserver_h =
! * "$Id: newserver.h,v 1.26 2002/07/15 04:57:12 mwedel Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_newserver_h =
! * "$Id: newserver.h,v 1.27 2003/03/19 08:04:50 mwedel Exp $";
*/
/*
***************
*** 120,126 ****
uint32 newmapcmd:1; /* Send newmap command when entering new map SMACFIGGEN*/
uint32 darkness:1; /* True if client wants darkness information */
uint32 image2:1; /* Client wants image2/face2 commands */
- uint32 newanim:1; /* enable the advanced animation system - MT */
uint32 cs_version, sc_version; /* versions of the client */
uint32 update_look:1; /* If true, we need to send the look window */
uint32 can_write:1; /* Can we write to this socket? */
--- 120,125 ----
Index: crossfire/plugin_animator/animator_box.c
diff -c crossfire/plugin_animator/animator_box.c:1.1 crossfire/plugin_animator/animator_box.c:1.2
*** crossfire/plugin_animator/animator_box.c:1.1 Sun Nov 11 04:55:37 2001
--- crossfire/plugin_animator/animator_box.c Wed Mar 19 00:04:51 2003
***************
*** 74,83 ****
int dir=id;
int face;
printf ("Turning in direction %ld\n",id);
- if(op->contr->socket.newanim)
- face = dir%8;
- else
- face = dir ? (dir - 1) / 2 : -1;
op->facing=dir;
GCFP.Value[0]=op;
GCFP.Value[1]=&face;
--- 74,79 ----
Index: crossfire/server/move.c
diff -c crossfire/server/move.c:1.27 crossfire/server/move.c:1.28
*** crossfire/server/move.c:1.27 Wed Feb 19 22:46:57 2003
--- crossfire/server/move.c Wed Mar 19 00:04:51 2003
***************
*** 1,6 ****
/*
* static char *rcsid_move_c =
! * "$Id: move.c,v 1.27 2003/02/20 06:46:57 mwedel Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_move_c =
! * "$Id: move.c,v 1.28 2003/03/19 08:04:51 mwedel Exp $";
*/
/*
***************
*** 234,240 ****
if (!(get_map_flags(other_teleporter->map, NULL,
other_teleporter->x + freearr_x[k],
other_teleporter->y + freearr_y[k], NULL,NULL) &
! P_NO_PASS)) break;
}
if (k==9) {
LOG(llevError,"Shop mat %s (%d, %d) is in solid rock?\n",
--- 234,240 ----
if (!(get_map_flags(other_teleporter->map, NULL,
other_teleporter->x + freearr_x[k],
other_teleporter->y + freearr_y[k], NULL,NULL) &
! (P_NO_PASS | P_OUT_OF_MAP))) break;
}
if (k==9) {
LOG(llevError,"Shop mat %s (%d, %d) is in solid rock?\n",
Index: crossfire/server/player.c
diff -c crossfire/server/player.c:1.125 crossfire/server/player.c:1.126
*** crossfire/server/player.c:1.125 Fri Mar 7 21:35:32 2003
--- crossfire/server/player.c Wed Mar 19 00:04:52 2003
***************
*** 1,6 ****
/*
* static char *rcsid_player_c =
! * "$Id: player.c,v 1.125 2003/03/08 05:35:32 mwedel Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_player_c =
! * "$Id: player.c,v 1.126 2003/03/19 08:04:52 mwedel Exp $";
*/
/*
***************
*** 1979,1999 ****
}
int move_player(object *op,int dir) {
! int face, pick;
!
! if(op->contr->socket.newanim)
! face = dir%8;
! else
! face = dir ? (dir - 1) / 2 : -1;
if(op->map == NULL || op->map->in_memory != MAP_IN_MEMORY)
return 0;
/* peterm: added following line */
- op->facing = dir;
if(QUERY_FLAG(op,FLAG_CONFUSED) && dir)
dir = absdir(dir + RANDOM()%3 + RANDOM()%3 - 2);
if(op->hide) do_hidden_move(op);
if(op->contr->fire_on) {
--- 1979,1995 ----
}
int move_player(object *op,int dir) {
! int pick;
if(op->map == NULL || op->map->in_memory != MAP_IN_MEMORY)
return 0;
/* peterm: added following line */
if(QUERY_FLAG(op,FLAG_CONFUSED) && dir)
dir = absdir(dir + RANDOM()%3 + RANDOM()%3 - 2);
+ op->facing = dir;
+
if(op->hide) do_hidden_move(op);
if(op->contr->fire_on) {
***************
*** 2001,2021 ****
}
else move_player_attack(op,dir);
/* Add special check for newcs players and fire on - this way, the
* server can handle repeat firing.
*/
- pick = check_pick(op);
if (op->contr->fire_on || (op->contr->run_on && pick!=0)) {
op->direction = dir;
} else {
op->direction=0;
}
!
! if(face != -1)
! SET_ANIMATION(op,face);
!
! update_object(op, UP_OBJ_FACE);
!
return 0;
}
--- 1997,2018 ----
}
else move_player_attack(op,dir);
+ pick = check_pick(op);
+
+
/* Add special check for newcs players and fire on - this way, the
* server can handle repeat firing.
*/
if (op->contr->fire_on || (op->contr->run_on && pick!=0)) {
op->direction = dir;
} else {
op->direction=0;
}
! /* Update how the player looks. Use the facing, so direction may
! * get reset to zero. This allows for full animation capabilities
! * for players.
! */
! animate_object(op, op->facing);
return 0;
}
Index: crossfire/server/spell_effect.c
diff -c crossfire/server/spell_effect.c:1.102 crossfire/server/spell_effect.c:1.103
*** crossfire/server/spell_effect.c:1.102 Fri Mar 7 21:35:33 2003
--- crossfire/server/spell_effect.c Wed Mar 19 00:04:52 2003
***************
*** 1,6 ****
/*
* static char *rcsid_spell_effect_c =
! * "$Id: spell_effect.c,v 1.102 2003/03/08 05:35:33 mwedel Exp $";
*/
--- 1,6 ----
/*
* static char *rcsid_spell_effect_c =
! * "$Id: spell_effect.c,v 1.103 2003/03/19 08:04:52 mwedel Exp $";
*/
***************
*** 3399,3405 ****
} else {
/* If we got here, we are consecrating an altar */
if(tmp->name) free_string(tmp->name);
! sprintf(buf,"%s of %s",tmp->arch->clone.name,god->name);
tmp->name = add_string(buf);
tmp->level = SK_level(op);
tmp->other_arch = god->arch;
--- 3399,3405 ----
} else {
/* If we got here, we are consecrating an altar */
if(tmp->name) free_string(tmp->name);
! sprintf(buf,"Altar of %s",god->name);
tmp->name = add_string(buf);
tmp->level = SK_level(op);
tmp->other_arch = god->arch;
Index: crossfire/socket/init.c
diff -c crossfire/socket/init.c:1.27 crossfire/socket/init.c:1.28
*** crossfire/socket/init.c:1.27 Mon Aug 26 00:14:11 2002
--- crossfire/socket/init.c Wed Mar 19 00:04:51 2003
***************
*** 1,6 ****
/*
* static char *rcsid_init_c =
! * "$Id: init.c,v 1.27 2002/08/26 07:14:11 mwedel Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_init_c =
! * "$Id: init.c,v 1.28 2003/03/19 08:04:51 mwedel Exp $";
*/
/*
***************
*** 104,110 ****
ns->skillexp = 0;
ns->mapmode = Map0Cmd;
ns->darkness = 1;
- ns->newanim = 0;
ns->status = Ns_Add;
ns->comment = NULL;
ns->old_mode = 0;
--- 104,109 ----
Index: crossfire/socket/request.c
diff -c crossfire/socket/request.c:1.46 crossfire/socket/request.c:1.47
*** crossfire/socket/request.c:1.46 Sun Mar 2 21:13:08 2003
--- crossfire/socket/request.c Wed Mar 19 00:04:51 2003
***************
*** 1,6 ****
/*
* static char *rcsid_init_c =
! * "$Id: request.c,v 1.46 2003/03/03 05:13:08 mwedel Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_init_c =
! * "$Id: request.c,v 1.47 2003/03/19 08:04:51 mwedel Exp $";
*/
/*
***************
*** 136,146 ****
strcat(cmdback, " ");
! if (!strcmp(cmd,"newanim")) {
! ns->newanim = atoi(param);
! strcat(cmdback, param);
! }
! else if (!strcmp(cmd,"sound")) {
ns->sound = atoi(param);
strcat(cmdback, param);
}
--- 136,142 ----
strcat(cmdback, " ");
! if (!strcmp(cmd,"sound")) {
ns->sound = atoi(param);
strcat(cmdback, param);
}
|