1 | /* |
1 | /* |
2 | * static char *rcsid_monster_c = |
2 | * static char *rcsid_monster_c = |
3 | * "$Id: monster.c,v 1.6 2006/04/22 15:10:08 elmex Exp $"; |
3 | * "$Id: monster.c,v 1.7 2006/07/03 12:31:24 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 | |
… | |
… | |
444 | return 0; |
444 | return 0; |
445 | } /* no enemy */ |
445 | } /* no enemy */ |
446 | |
446 | |
447 | /* We have an enemy. Block immediately below is for pets */ |
447 | /* We have an enemy. Block immediately below is for pets */ |
448 | if((op->attack_movement&HI4) == PETMOVE && (owner = get_owner(op)) != NULL && !on_same_map(op,owner)) |
448 | if((op->attack_movement&HI4) == PETMOVE && (owner = get_owner(op)) != NULL && !on_same_map(op,owner)) |
449 | { |
|
|
450 | follow_owner(op, owner); |
449 | return follow_owner(op, owner); |
451 | /* If the pet was unable to follow the owner, free it */ |
|
|
452 | if(QUERY_FLAG(op, FLAG_REMOVED) && FABS(op->speed) > MIN_ACTIVE_SPEED) { |
|
|
453 | remove_friendly_object(op); |
|
|
454 | free_object(op); |
|
|
455 | return 1; |
|
|
456 | } |
|
|
457 | return 0; |
|
|
458 | } |
|
|
459 | |
450 | |
460 | /* doppleganger code to change monster facing to that of the nearest |
451 | /* doppleganger code to change monster facing to that of the nearest |
461 | * player. Hmm. The code is here, but no monster in the current |
452 | * player. Hmm. The code is here, but no monster in the current |
462 | * arch set uses it. |
453 | * arch set uses it. |
463 | */ |
454 | */ |