[CF-Devel] Death message fix

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Mon Nov 15 11:30:42 CST 2004


Salathar wrote:
>
     
      What do you think of the general idea?
     
     
The idea is good, but the solution does not work:

>
     
      *** crossfire/server/attack.c   10 Sep 2004 07:03:45 -0000      1.101
     
     >
     
      --- crossfire/server/attack.c   13 Nov 2004 16:21:01 -0000
     
     >
     
      ***************
     
     >
     
      *** 1404,1409 ****
     
     >
     
      --- 1404,1413 ----
     
     >
     
             */
     
     >
     
            maxdam = dam + op->stats.hp + 1;
     
     >
     
     
     >
     
      +     /* If we think we are killing another player and they don't die then give up */
     
     >
     
      +      if (op->type == PLAYER && !kill_player(op))
     
     >
     
      +          return 0;
     
     >
     
      +
     
     >
     
            if(QUERY_FLAG(op,FLAG_BLOCKSVIEW))
     
     >
     
              update_all_los(op->map,op->x, op->y); /* makes sure los will be recalculated */
     
     
You call kill_player() from kill_object(). The function kill_object()
records the killer in op->contr->killer (see the last few lines of that
function), kill_player() uses this information to create a gravestone.

Therefore (after your change), kill_player() uses a variable that is not
yet set by kill_object(): You get a gravestone that reads "...who was
killed by .".

_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list