Crossfire Server, Trunk
friend.c File Reference
#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)
 
void clean_friendly_list (void)
 
void dump_friendly_objects (void)
 
int is_friendly (const object *op)
 
void remove_friendly_object (object *op)
 

Detailed Description

Functions related to relationship management.

Definition in file friend.c.

Function Documentation

◆ add_friendly_object()

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 first_friendly_object, get_objectlink(), oblnk::id, is_friendly(), llevError, LOG(), oblnk::next, oblnk::ob, and give::op.

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(), use_oratory(), and while().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clean_friendly_list()

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 disinfect::count, first_friendly_object, FLAG_FREED, FLAG_FRIENDLY, llevDebug, LOG(), give::next, oblnk::next, guildjoin::ob, and QUERY_FLAG.

Referenced by do_specials().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dump_friendly_objects()

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:

◆ is_friendly()

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, oblnk::ob, and give::op.

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

+ Here is the caller graph for this function:

◆ remove_friendly_object()

void remove_friendly_object ( object op)