1 | /* |
1 | /* |
2 | * static char *rcsid_living_c = |
2 | * static char *rcsid_living_c = |
3 | * "$Id: living.C,v 1.6 2006/09/07 09:37:12 pippijn Exp $"; |
3 | * "$Id: living.C,v 1.7 2006/09/09 21:48:28 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
368 | * will clear the bits, but the player may still have some other object |
368 | * will clear the bits, but the player may still have some other object |
369 | * that gives them that ability. |
369 | * that gives them that ability. |
370 | */ |
370 | */ |
371 | int change_abil(object *op, object *tmp) { |
371 | int change_abil(object *op, object *tmp) { |
372 | int flag=QUERY_FLAG(tmp,FLAG_APPLIED)?1:-1,i,j,success=0; |
372 | int flag=QUERY_FLAG(tmp,FLAG_APPLIED)?1:-1,i,j,success=0; |
373 | object refop; |
|
|
374 | char message[MAX_BUF]; |
373 | char message[MAX_BUF]; |
375 | int potion_max=0; |
374 | int potion_max=0; |
376 | |
375 | |
377 | /* remember what object was like before it was changed. note that |
376 | /* remember what object was like before it was changed. note that |
378 | * refop is a local copy of op only to be used for detecting changes |
377 | * refop is a local copy of op only to be used for detecting changes |
379 | * found by fix_player. refop is not a real object |
378 | * found by fix_player. refop is not a real object |
380 | */ |
379 | */ |
381 | memcpy(&refop, op, sizeof(object)); |
380 | object_pod refop; |
|
|
381 | memcpy (&refop, static_cast<object_pod *>(op), sizeof (object_pod)); |
382 | |
382 | |
383 | if(op->type==PLAYER) { |
383 | if(op->type==PLAYER) { |
384 | if (tmp->type==POTION) { |
384 | if (tmp->type==POTION) { |
385 | potion_max=1; |
385 | potion_max=1; |
386 | for(j=0;j<NUM_STATS;j++) { |
386 | for(j=0;j<NUM_STATS;j++) { |