Crossfire Server, Trunk  R20513
Functions
friend.c File Reference

Functions related to relationship management. More...

#include "global.h"
#include <stdlib.h>
Include dependency graph for friend.c:

Go to the source code of this file.

Functions

void add_friendly_object (object *op)
 Add a new friendly object to the linked list of friendly objects. More...
 
void clean_friendly_list (void)
 It traverses the friendly list removing objects that should not be here (ie, do not have friendly flag set, freed, etc) More...
 
void dump_friendly_objects (void)
 Dumps all friendly objects. More...
 
int is_friendly (const object *op)
 Checks if the given object is already in the friendly list or not Lauwenmark - 31/07/05. More...
 
void remove_friendly_object (object *op)
 Removes the specified object from the linked list of friendly objects. More...
 

Detailed Description

Functions related to relationship management.

Definition in file friend.c.

Function Documentation

void add_friendly_object ( object op)

Add a new friendly object to the linked list of friendly objects.

Will log an error if the object is already on that list.

Parameters
opobject to add to the list.

Definition at line 30 of file friend.c.

References obj::count, first_friendly_object, get_objectlink(), oblnk::id, is_friendly(), llevError, LOG(), obj::name, oblnk::next, and oblnk::ob.

Referenced by add_player(), animate_weapon(), cfapi_object_set_property(), change_object(), do_mood_floor(), fix_summon_pet(), mood_change(), pets_summon_golem(), pets_summon_object(), polymorph_living(), receive_play_again(), and use_oratory().

Here is the call graph for this function:

Here is the caller graph for this function:

void clean_friendly_list ( void  )

It traverses the friendly list removing objects that should not be here (ie, do not have friendly flag set, freed, etc)

Definition at line 111 of file friend.c.

References first_friendly_object, FLAG_FREED, FLAG_FRIENDLY, llevDebug, LOG(), oblnk::next, and QUERY_FLAG.

Referenced by do_specials().

Here is the call graph for this function:

Here is the caller graph for this function:

void dump_friendly_objects ( void  )

Dumps all friendly objects.

Invoked in DM-mode with dumpfriendlyobjects command.

Note
logs at the error level.

Definition at line 100 of file friend.c.

References obj::count, first_friendly_object, llevError, LOG(), obj::name, oblnk::next, and oblnk::ob.

Referenced by command_dumpfriendlyobjects().

Here is the call graph for this function:

Here is the caller graph for this function:

int is_friendly ( const object op)

Checks if the given object is already in the friendly list or not Lauwenmark - 31/07/05.

Parameters
opitem to check
Returns
1 if on friendly list, 0 else

Definition at line 144 of file friend.c.

References first_friendly_object, oblnk::next, and oblnk::ob.

Referenced by add_friendly_object(), cfapi_object_get_property(), and cfapi_object_set_property().

Here is the caller graph for this function:

void remove_friendly_object ( object op)

Removes the specified object from the linked list of friendly objects.

Parameters
opobject to remove from list.

Definition at line 56 of file friend.c.

References CLEAR_FLAG, obj::count, first_friendly_object, FLAG_FRIENDLY, llevError, LOG(), obj::name, oblnk::next, and oblnk::ob.

Referenced by cfapi_object_set_property(), change_object(), command_cast_spell(), command_kill_pets(), do_mood_floor(), enter_map(), get_nearest_player(), hit_player(), kill_object(), kill_player_permadeath(), monster_move(), mood_change(), object_clear(), object_free2(), pets_get_enemy(), pets_move(), pets_move_golem(), pets_remove_all(), pets_terminate_all(), polymorph_living(), receive_play_again(), and use_oratory().

Here is the call graph for this function:

Here is the caller graph for this function: