Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CF: Patch: peaceful fix



Hi,

this one fixes the (former) number #1 cause of death on our server.
The problem: if two players are peaceful, they will still attack each
other if one player does "something bad" to the other player (even if
the "bad" thing doesn't do any harm at all!). The most common case
of is casting fire to remove boulders etc. The fix makes the game
respect "peaceful" in any case --- if you want to kill another player,
make yourself unpeaceful.

------------------------------ Cut ------------------------------

diff -r -C 5 crossfire-0.93.7/server/player.c crossfire/server/player.c
*** crossfire-0.93.7/server/player.c	Tue Jan  6 10:29:24 1998
--- crossfire/server/player.c	Fri Jan  9 12:46:41 1998
***************
*** 1423,1433 ****
       * object should be pushed instead of attacked.  It is assumed that
       * if you are braced, you will not attack friends accidently,
       * and thus will not push them.
       */
  
!     if (tmp->enemy != op &&
        (tmp->type==PLAYER || QUERY_FLAG(tmp,FLAG_UNAGGRESSIVE)
  	|| QUERY_FLAG(tmp, FLAG_FRIENDLY)) &&
  	op->contr->peaceful && (!op->contr->braced)) {
  #ifdef SOUND_EFFECTS
  	  play_sound_map(op->map, op->x, op->y, SOUND_PUSH_PLAYER);
--- 1423,1433 ----
       * object should be pushed instead of attacked.  It is assumed that
       * if you are braced, you will not attack friends accidently,
       * and thus will not push them.
       */
  
!     if ((tmp->type==PLAYER || tmp->enemy != op) &&
        (tmp->type==PLAYER || QUERY_FLAG(tmp,FLAG_UNAGGRESSIVE)
  	|| QUERY_FLAG(tmp, FLAG_FRIENDLY)) &&
  	op->contr->peaceful && (!op->contr->braced)) {
  #ifdef SOUND_EFFECTS
  	  play_sound_map(op->map, op->x, op->y, SOUND_PUSH_PLAYER);
[to unsubscribe etc., send mail to crossfire-request@ifi.uio.no]