[CF-Devel] Minor fix to a major bug.

crossfire-devel-admin at archives.real-time.com crossfire-devel-admin at archives.real-time.com
Sat Oct 18 21:18:04 CDT 2003


Ok, after i finally was able to compile the server for which i had to change a
misspelling (see the misspelling.diff file i'm sending), i realized my previous
patch wouldnt work cause i used the wrong variable inside the if, but now i
changed it and tested and it seems to work fine, not blocking the shift key for
firing nor the control key for running. 

I hope it can be uploaded to the CVS soon (and even beeing updated in the
metalforge servers) or it could be of use for those that maybe already knew
about this bug.

Any comments apreciated as always :)
Katia.
--
+-----------------------------+
|
     
      Karla  Mª  Stenger  Sábat   |
     
     |
     
      Pando . Canelones . Uruguay |
     
     |
     
     
      kstenger at montevideo.com.uy
      
        |
     
     +-----------------------------+
-------------- next part --------------
Index: player.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/server/player.c,v
retrieving revision 1.134
diff -u -r1.134 player.c
--- player.c	7 Oct 2003 07:02:02 -0000	1.134
+++ player.c	19 Oct 2003 02:05:22 -0000
@@ -1974,7 +1974,7 @@
 	     * the wiz.
 	     */
 	    if (mon->type == PLAYER && mon->stats.hp >= 0 && !mon->contr->has_hit &&
-		!on_battleGround && !QUERY_FLAG(mon, FLAG_WIZ)) {
+		!on_battleground && !QUERY_FLAG(mon, FLAG_WIZ)) {
 		short luck = mon->stats.luck;
 		mon->contr->has_hit = 1;
 		skill_attack(op, mon, 0, NULL, NULL);
-------------- next part --------------
Index: c_new.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/server/c_new.c,v
retrieving revision 1.6
diff -u -r1.6 c_new.c
--- c_new.c	20 Mar 2002 06:27:46 -0000	1.6
+++ c_new.c	19 Oct 2003 02:01:01 -0000
@@ -114,8 +114,15 @@
 
 int command_run(object *op, char *params)
 {
+    int dir;
     op->contr->run_on=1;
-    return (move_player(op, params?atoi(params):0));
+    dir = params?atoi(params):0;
+    if ( dir <0 || dir >=9 ){
+        new_draw_info(NDI_UNIQUE, 0,op,"Can't run into a non adjacent square.");
+        return 0;
+    }
+    else
+        return move_player(op, dir);
 }
 
 int command_run_stop(object *op, char *params)
@@ -126,8 +133,15 @@
 
 int command_fire(object *op, char *params)
 {
+    int dir;
     op->contr->fire_on=1;
-    return move_player(op, params?atoi(params):0);
+    dir = params?atoi(params):0;
+    if ( dir <0 || dir >=9 ){
+        new_draw_info(NDI_UNIQUE, 0,op,"Can't fire to a non adjacent square.");
+        return 0;
+    }
+    else
+        return move_player(op, dir);
 }
 
 int command_fire_stop(object *op, char *params)
    
    


More information about the crossfire mailing list