|
From: <cro...@li...> - 2003-08-22 10:22:16
|
Module Name: crossfire
Committed By: temitchell
Date: Thu Aug 21 20:00:08 UTC 2003
Modified Files:
crossfire/server: c_wiz.c
Log Message:
- moved get_other_player_from_name to beginning of the file to clear
"assignment makes pointer from int without a cast" warnings up.
Start of context diffs
Index: crossfire/server/c_wiz.c
diff -c crossfire/server/c_wiz.c:1.34 crossfire/server/c_wiz.c:1.35
*** crossfire/server/c_wiz.c:1.34 Fri Jul 25 19:10:40 2003
--- crossfire/server/c_wiz.c Thu Aug 21 13:00:07 2003
***************
*** 1,6 ****
/*
* static char *rcsid_c_wiz_c =
! * "$Id: c_wiz.c,v 1.34 2003/07/26 02:10:40 temitchell Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_c_wiz_c =
! * "$Id: c_wiz.c,v 1.35 2003/08/21 20:00:07 temitchell Exp $";
*/
/*
***************
*** 42,47 ****
--- 42,80 ----
#include <treasure.h>
#include <skills.h>
+ /* Enough of the DM functions seem to need this that I broke
+ * it out to a seperate function. name is the person
+ * being saught, rq is who is looking for them. This
+ * prints diagnostics messages, and returns the
+ * other player, or NULL otherwise.
+ */
+ static player *get_other_player_from_name(object *op, char *name)
+ {
+ player *pl;
+
+ if (!name) return NULL;
+
+ for(pl=first_player;pl!=NULL;pl=pl->next)
+ if(!strncmp(pl->ob->name, name, MAX_NAME))
+ break;
+
+ if(pl==NULL) {
+ new_draw_info(NDI_UNIQUE, 0,op,"No such player.");
+ return NULL;
+ }
+
+ if (pl->ob == op) {
+ new_draw_info(NDI_UNIQUE, 0, op, "You can't do that to yourself.");
+ return NULL;
+ }
+ if(pl->state != ST_PLAYING) {
+ new_draw_info(NDI_UNIQUE, 0,op,"That player is in no state for that right now.");
+ return NULL;
+ }
+ return pl;
+ }
+
+
int command_loadtest(object *op, char *params){
int x,y;
char buf[1024];
***************
*** 318,357 ****
}
}
return 1;
! }
!
!
! /* Enough of the DM functions seem to need this that I broke
! * it out to a seperate function. name is the person
! * being saught, rq is who is looking for them. This
! * prints diagnostics messages, and returns the
! * other player, or NULL otherwise.
! */
! static player *get_other_player_from_name(object *op, char *name)
! {
! player *pl;
!
! if (!name) return NULL;
!
! for(pl=first_player;pl!=NULL;pl=pl->next)
! if(!strncmp(pl->ob->name, name, MAX_NAME))
! break;
!
! if(pl==NULL) {
! new_draw_info(NDI_UNIQUE, 0,op,"No such player.");
! return NULL;
! }
!
! if (pl->ob == op) {
! new_draw_info(NDI_UNIQUE, 0, op, "You can't do that to yourself.");
! return NULL;
! }
! if(pl->state != ST_PLAYING) {
! new_draw_info(NDI_UNIQUE, 0,op,"That player is in no state for that right now.");
! return NULL;
! }
! return pl;
! }
int command_freeze(object *op, char *params)
{
--- 351,357 ----
}
}
return 1;
! }
int command_freeze(object *op, char *params)
{
|