Crossfire Server, Branch 1.12  R12190
Defines | Functions
player.c File Reference

Player-related functions, including those used during the login and creation phases. More...

#include <global.h>
#include <assert.h>
#include <pwd.h>
#include <sproto.h>
#include <sounds.h>
#include <living.h>
#include <object.h>
#include <spells.h>
#include <skills.h>
#include <newclient.h>
Include dependency graph for player.c:

Go to the source code of this file.

Defines

#define DETOUR_AMOUNT   2
 This value basically determines how large a detour a monster will take from the direction path when looking for a path to the player.
#define MAX_SPACES   50
 This is used to prevent infinite loops.

Functions

static int action_makes_visible (object *op)
 We call this when there is a possibility for our action disturbing our hiding place or invisiblity spell.
void add_player (socket_struct *ns)
 Tries to add player on the connection passwd in ns.
void cast_dust (object *op, object *throw_ob, int dir)
 Handles op throwing objects of type 'DUST'.
int check_pick (object *op)
 Sees if there is stuff to be picked up/picks up stuff, for players only.
void confirm_password (object *op)
 Ask the player to confirm her password during creation.
void display_motd (const object *op)
 Sends the message of the day to the player.
void do_hidden_move (object *op)
 For hidden creatures - a chance of becoming 'unhidden' every time they move - as we subtract off 'invisibility' AND, for players, if they move into a ridiculously unhideable spot (surrounded by clear terrain in broad daylight).
void do_some_living (object *op)
 Regenerate hp/sp/gr, decreases food.
void dragon_ability_gain (object *who, int atnr, int level)
 When a dragon-player gains a new stage of evolution, he gets some treasure.
static object * find_arrow (object *op, const char *type)
 Find an arrow in the inventory and after that in the right type container (quiver).
static object * find_better_arrow (object *op, object *target, const char *type, int *better)
 Similar to find_arrow(), but looks for (roughly) the best arrow to use against the target.
object * find_key (object *pl, object *container, object *door)
 We try to find a key for the door as passed.
playerfind_player (const char *plname)
 Find a player by her full name.
playerfind_player_partial_name (const char *plname)
 Find a player by a partial name.
void fire (object *op, int dir)
 Received a fire command for the player - go and do it.
int fire_bow (object *op, object *arrow, int dir, int wc_mod, sint16 sx, sint16 sy)
 Creature (monster or player) fires a bow.
static void fire_misc_object (object *op, int dir)
 Fires a misc (wand/rod/horn) object in 'dir'.
void fix_luck (void)
 Fixes luck of players, slowly move it towards 0.
void fix_weight (void)
 Check recursively the weight of all players, and fix what needs to be fixed.
static void flee_player (object *op)
 The player is scared, and should flee.
void get_name (object *op)
 Waiting for the player's name.
object * get_nearest_player (object *mon)
 Finds the nearest visible player for some object.
void get_party_password (object *op, partylist *party)
 Ask the player for the password of the party she wants to join.
void get_password (object *op)
 Waiting for the player's password.
static playerget_player (player *p)
 Create a player's object, initialize a player's structure.
static archetype * get_player_archetype (archetype *at)
 Get next player archetype from archetype list.
void give_initial_items (object *pl, treasurelist *items)
 Gives a new player her initial items.
static const char * gravestone_text (object *op, char *buf2, int len)
 Create a text for a player's gravestobe.
int handle_newcs_player (object *op)
 Handles commands the player can send us, and various checks on invisibility, golem and such.
int hideability (object *ob)
 Look at the surrounding terrain to determine the hideability of this object.
int is_true_undead (object *op)
 Is the object a true undead?
void key_change_class (object *op, char key)
 This function takes the key that is passed, and does the appropriate action with it (change race, or other things).
void key_confirm_quit (object *op, char key)
 We receive the reply to the 'quit confirmation' message.
void key_roll_stat (object *op, char key)
 Player is currently swapping stats.
void kill_player (object *op)
 When a player should die (lack of hp, food, etc), we call this.
static void loot_object (object *op)
 Grab and destroy some treasure.
void make_visible (object *op)
 Makes an object visible again.
int move_player (object *op, int dir)
 Player gave us a direction, check whether to move or fire.
void move_player_attack (object *op, int dir)
 The player is also actually going to try and move (not fire weapons).
int op_on_battleground (object *op, int *x, int *y, archetype **trophy)
 Checks if the given object op (usually a player) is standing on a valid battleground-tile.
int path_to_player (object *mon, object *pl, unsigned mindiff)
 Returns the direction to the player, if valid.
static object * pick_arrow_target (object *op, const char *type, int dir)
 Looks in a given direction, finds the first valid target, and calls find_better_arrow() to find a decent arrow to use.
void play_again (object *op)
 Ask the player whether to play again or disconnect.
static int player_attack_door (object *op, object *door)
 Player is "attacking" a door.
int player_can_view (object *pl, object *op)
 Check the player los field for viewability of the object op.
static int player_fire_bow (object *op, int dir)
 Special fire code for players - this takes into account the special fire modes players can have but monsters can't.
void player_unready_range_ob (player *pl, object *ob)
 Unready an object for a player.
int playername_ok (const char *cp)
 Is the player name valid.
void receive_play_again (object *op, char key)
 Player replied to play again / disconnect.
void remove_unpaid_objects (object *op, object *env, int free_items)
 This goes throws the inventory and removes unpaid objects, and puts them back in the map (location and map determined by values of env) or frees them.
void roll_again (object *op)
 Ask the player what to do with the statistics.
int roll_stat (void)
 This rolls four 1-6 rolls and sums the best 3 of the 4.
void roll_stats (object *op)
 Roll the initial player's statistics.
static int save_life (object *op)
 Can the player be saved by an item?
void send_news (const object *op)
 Send the news to a player.
void send_rules (const object *op)
 Send the rules to a player.
static void set_first_map (object *op)
 This loads the first map an puts the player on it.
int stand_near_hostile (object *who)
 Determine if who is standing near a hostile creature.
static void swap_stat (object *op, int Swap_Second)
 Player finishes selecting what stats to swap.
static int turn_one_transport (object *transport, object *captain, int dir)
 Turn a transport to an adjacent direction (+1 or -1), updating the move_type flags in the same process.
static int turn_transport (object *transport, object *captain, int dir)
 Try to turn a transport in the desired direction.
static void update_transport_block (object *transport, int dir)
 Update the move_type of a transport based on the direction.

Detailed Description

Player-related functions, including those used during the login and creation phases.

Todo:
describe login/creation functions/cycles.

Definition in file player.c.


Define Documentation

#define DETOUR_AMOUNT   2

This value basically determines how large a detour a monster will take from the direction path when looking for a path to the player.

The values are in the amount of direction the deviation is.

I believe this can safely go to 2, 3 is questionable, 4 will likely result in a monster paths backtracking.

Definition at line 508 of file player.c.

Referenced by path_to_player().

#define MAX_SPACES   50

This is used to prevent infinite loops.

Consider a case where the player is in a chamber (with gate closed), and monsters are outside. with DETOUR_AMOUNT==2, the function will turn each corner, trying to find a path into the chamber. This is a good thing, but since there is no real path, it will just keep circling the chamber for ever (this could be a nice effect for monsters, but not for the function to get stuck in. I think for the monsters, if max is reached and we return the first direction the creature could move would result in the circling behaviour. Unfortunately, this function is also used to determined if the creature should cast a spell, so returning a direction in that case is probably not a good thing.

Definition at line 523 of file player.c.

Referenced by path_to_player().


Function Documentation

static int action_makes_visible ( object *  op) [static]

We call this when there is a possibility for our action disturbing our hiding place or invisiblity spell.

Artefact invisiblity is not effected by this. If we arent invisible to begin with, we return 0.

This routine works for both players and monsters.

Parameters:
opobject to check.
Returns:
1 if op isn't invisible anymore, 0 else.

Definition at line 3958 of file player.c.

References draw_ext_info_format(), FLAG_ALIVE, FLAG_MAKE_INVIS, MSG_SUBTYPE_NONE, MSG_TYPE_MISC, NDI_UNIQUE, and QUERY_FLAG.

Referenced by fire(), move_player_attack(), and player_attack_door().

Here is the call graph for this function:

Here is the caller graph for this function:

void add_player ( socket_struct ns)

Tries to add player on the connection passwd in ns.

Player object is created and put on the first map, rules/news/motd are sent.

Parameters:
nsconnection.

Definition at line 383 of file player.c.

References add_friendly_object(), CLEAR_FLAG, display_motd(), socket_struct::faces_sent, fatal(), FLAG_FRIENDLY, get_name(), get_player(), socket_struct::inbuf, pl::ob, OUT_OF_MEMORY, send_news(), send_rules(), set_first_map(), pl::socket, and SockList_ResetRead().

Referenced by add_me_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

void cast_dust ( object *  op,
object *  throw_ob,
int  dir 
)

Handles op throwing objects of type 'DUST'.

This is much simpler in the new spell code - we basically just treat this as any other spell casting object.

Parameters:
opobject throwing.
throw_obwhat to throw.
dirdirection to throw into.

Definition at line 3682 of file player.c.

References cast_spell(), draw_ext_info_format(), find_skill_by_name(), FLAG_REMOVED, free_object(), llevError, LOG(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_SUCCESS, NDI_UNIQUE, PLAYER, POTION, QUERY_FLAG, and remove_ob().

Referenced by do_throw().

Here is the call graph for this function:

Here is the caller graph for this function:

int check_pick ( object *  op)
void confirm_password ( object *  op)

Ask the player to confirm her password during creation.

Parameters:
opplayer.

Definition at line 877 of file player.c.

References CS_QUERY_HIDEINPUT, send_query(), and ST_CONFIRM_PASSWORD.

Referenced by check_login().

Here is the call graph for this function:

Here is the caller graph for this function:

void display_motd ( const object *  op)

Sends the message of the day to the player.

Parameters:
opplayer to send to.

Definition at line 112 of file player.c.

References close_and_delete(), Settings::confdir, draw_ext_info(), HUGE_BUF, MAX_BUF, Settings::motd, MSG_SUBTYPE_NONE, MSG_TYPE_MOTD, NDI_GREEN, NDI_UNIQUE, open_and_uncompress(), settings, and snprintf().

Referenced by add_player(), command_motd(), and receive_player_password().

Here is the call graph for this function:

Here is the caller graph for this function:

void do_hidden_move ( object *  op)

For hidden creatures - a chance of becoming 'unhidden' every time they move - as we subtract off 'invisibility' AND, for players, if they move into a ridiculously unhideable spot (surrounded by clear terrain in broad daylight).

-b.t.

Parameters:
opobject moving.

Definition at line 3796 of file player.c.

References calc_skill_exp(), change_exp(), draw_ext_info(), find_obj_by_type_subtype(), hide(), hideability(), make_visible(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, PLAYER, PREFER_LOW, random_roll(), SK_HIDING, and SKILL.

Referenced by move_monster(), and move_player().

Here is the call graph for this function:

Here is the caller graph for this function:

void do_some_living ( object *  op)

Regenerate hp/sp/gr, decreases food.

This only works for players. Will grab food if needed, or kill player.

Parameters:
opplayer to regenerate for.

Definition at line 3017 of file player.c.

References flush_output_element(), NUM_OUTPUT_BUFS, pticks, and ST_PLAYING.

Referenced by command_possess(), and process_players1().

Here is the call graph for this function:

Here is the caller graph for this function:

void dragon_ability_gain ( object *  who,
int  atnr,
int  level 
)
static object* find_arrow ( object *  op,
const char *  type 
) [static]

Find an arrow in the inventory and after that in the right type container (quiver).

Pointer to the found object is returned.

Parameters:
opobject to find arrow for.
typewhat arrow race to search for.
Returns:
suitable arrow, NULL if none found.

Definition at line 1751 of file player.c.

References ARROW, CONTAINER, FLAG_APPLIED, and QUERY_FLAG.

Referenced by find_better_arrow(), fire_bow(), and pick_arrow_target().

Here is the caller graph for this function:

static object* find_better_arrow ( object *  op,
object *  target,
const char *  type,
int *  better 
) [static]

Similar to find_arrow(), but looks for (roughly) the best arrow to use against the target.

A full test is not performed, simply a basic test of resistances. The archer is making a quick guess at what he sees down the hall. Failing that it does it's best to pick the highest plus arrow.

Parameters:
opwho to search arrows for.
targetwhat op is aiming at.
typearrow race to search for.
[out]betterwill contain the arrow's value if not NULL.
Returns:
suitable arrow, NULL if none found.

Definition at line 1782 of file player.c.

References ARROW, AT_DEATH, CONTAINER, find_arrow(), FLAG_APPLIED, NROFATTACKS, and QUERY_FLAG.

Referenced by pick_arrow_target().

Here is the call graph for this function:

Here is the caller graph for this function:

object* find_key ( object *  pl,
object *  container,
object *  door 
)

We try to find a key for the door as passed.

If we find a key and player can use it (based on the usekeys settings), we return the key, otherwise NULL.

This function merges both normal and locked door, since the logic for both is the same - just the specific key is different.

This function can be called recursively to search containers.

Parameters:
plplayer.
containerinventory to searched for keys.
doordoor we are trying to match against.
Returns:
key to use, NULL if none found or usekeys mode doesn't let reach the key.
Todo:
document use key modes.

Definition at line 2278 of file player.c.

References CONTAINER, DOOR, draw_ext_info_format(), find_key(), FLAG_APPLIED, KEY, key_inventory, keyrings, MAX_BUF, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, NDI_BROWN, NDI_UNIQUE, QUERY_FLAG, query_name(), and SPECIAL_KEY.

Referenced by apply_container(), find_key(), and player_attack_door().

Here is the call graph for this function:

Here is the caller graph for this function:

player* find_player ( const char *  plname)

Find a player by her full name.

Parameters:
plnamename to find.
Returns:
matching player, or NULL if no match.

Definition at line 62 of file player.c.

References first_player, MAX_BUF, pl::next, pl::ob, and query_name().

Referenced by command_reply(), and list_players().

Here is the call graph for this function:

Here is the caller graph for this function:

player* find_player_partial_name ( const char *  plname)

Find a player by a partial name.

Parameters:
plnamename to match.
Returns:
matching player if only one matching, or one perfectly matching, NULL if no match or more than one.

Definition at line 84 of file player.c.

References first_player, pl::next, pl::ob, and strncasecmp().

Referenced by cfapi_player_find(), command_follow(), command_stats(), command_teleport(), do_tell(), and process_players1().

Here is the call graph for this function:

Here is the caller graph for this function:

void fire ( object *  op,
int  dir 
)

Received a fire command for the player - go and do it.

Parameters:
opplayer.
dirdirection to fire into.

Definition at line 2204 of file player.c.

References action_makes_visible(), apply_map_builder(), cast_spell(), control_golem(), do_skill(), draw_ext_info(), fire_misc_object(), make_visible(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, player_fire_bow(), range_bow, range_builder, range_golem, range_magic, range_misc, range_none, and range_skill.

Referenced by command_stay(), and move_player().

Here is the call graph for this function:

Here is the caller graph for this function:

int fire_bow ( object *  op,
object *  arrow,
int  dir,
int  wc_mod,
sint16  sx,
sint16  sy 
)

Creature (monster or player) fires a bow.

Parameters:
opobject firing the bow.
arrowobject to fire.
dirdirection of fire.
wc_modany special modifier to give (used in special player fire modes)
sx
sycoordinates to fire arrow from - also used in some of the special player fire modes.
Returns:
1 if bow was actually fired, 0 otherwise.
Todo:
describe player firing modes.

Definition at line 1922 of file player.c.

References add_refcount(), add_string(), AT_PHYSICAL, BOW, bow_bestarrow, CLEAR_FLAG, dam_bonus, dex_bonus, draw_ext_info(), draw_ext_info_format(), FABS, find_arrow(), fix_object(), FLAG_NO_STRENGTH, FLAG_READY_BOW, free_object(), free_string(), get_map_flags(), GET_MAP_MOVE_BLOCK, get_split_ob(), insert_ob_in_map(), llevError, LOG(), MOVE_FLY_LOW, MOVE_WALK, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, ob_process(), P_OUT_OF_MAP, play_sound_map(), PLAYER, QUERY_FLAG, range_bow, remove_ob(), SET_ANIMATION, set_owner(), SOUND_TYPE_ITEM, strdup_local(), thaco_bonus, and update_ob_speed().

Referenced by monster_use_bow(), and player_fire_bow().

Here is the call graph for this function:

Here is the caller graph for this function:

static void fire_misc_object ( object *  op,
int  dir 
) [static]

Fires a misc (wand/rod/horn) object in 'dir'.

Broken apart from 'fire' to keep it more readable.

Parameters:
opplayer firing.
dirfiring direction.
Warning:
op must be a player (contr != NULL).

Definition at line 2143 of file player.c.

References cast_spell(), drain_rod_charge(), drain_wand_charge(), draw_ext_info(), draw_ext_info_format(), FLAG_BEEN_APPLIED, HORN, llevError, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_FAILURE, NDI_UNIQUE, play_sound_player_only(), query_base_name(), range_misc, ROD, SET_FLAG, SOUND_TYPE_ITEM, SP_level_spellpoint_cost(), SPELL_HIGHEST, and WAND.

Referenced by fire().

Here is the call graph for this function:

Here is the caller graph for this function:

void fix_luck ( void  )

Fixes luck of players, slowly move it towards 0.

Definition at line 3661 of file player.c.

References change_luck(), first_player, pl::next, and pl::ob.

Referenced by do_specials().

Here is the call graph for this function:

Here is the caller graph for this function:

void fix_weight ( void  )

Check recursively the weight of all players, and fix what needs to be fixed.

Refresh windows and fix speed if anything was changed.

Todo:
is this still useful?

Definition at line 3645 of file player.c.

References first_player, fix_object(), llevDebug, LOG(), pl::next, pl::ob, and sum_weight().

Referenced by do_specials().

Here is the call graph for this function:

Here is the caller graph for this function:

static void flee_player ( object *  op) [static]

The player is scared, and should flee.

If she can't, then she isn't scared anymore.

Parameters:
opplayer.

Definition at line 1329 of file player.c.

References absdir(), CLEAR_FLAG, did_make_save(), rv_vector::direction, FLAG_SCARED, get_rangevector(), llevDebug, LOG(), move_ob(), PREFER_LOW, and random_roll().

Referenced by handle_newcs_player().

Here is the call graph for this function:

Here is the caller graph for this function:

void get_name ( object *  op)

Waiting for the player's name.

Parameters:
opplayer.

Definition at line 786 of file player.c.

References send_query(), and ST_GET_NAME.

Referenced by add_player(), receive_play_again(), receive_player_name(), receive_player_password(), and wrong_password().

Here is the call graph for this function:

Here is the caller graph for this function:

object* get_nearest_player ( object *  mon)

Finds the nearest visible player for some object.

Parameters:
monwhat object is searching a player.
Returns:
player, or NULL if nothing suitable.

Definition at line 447 of file player.c.

References can_detect_enemy(), rv_vector::distance, first_friendly_object, first_player, FLAG_FREED, FLAG_FRIENDLY, llevDebug, LOG(), pl::next, pl::ob, QUERY_FLAG, and remove_friendly_object().

Referenced by find_enemy(), and move_monster().

Here is the call graph for this function:

Here is the caller graph for this function:

void get_party_password ( object *  op,
partylist party 
)

Ask the player for the password of the party she wants to join.

Parameters:
opplayer.
partyparty op wishes to join.

Definition at line 891 of file player.c.

References CS_QUERY_HIDEINPUT, llevError, LOG(), send_query(), and ST_GET_PARTY_PASSWORD.

Referenced by command_party().

Here is the call graph for this function:

Here is the caller graph for this function:

void get_password ( object *  op)

Waiting for the player's password.

Parameters:
opplayer.

Definition at line 798 of file player.c.

References CS_QUERY_HIDEINPUT, send_query(), and ST_GET_PASSWORD.

Referenced by receive_player_name().

Here is the call graph for this function:

Here is the caller graph for this function:

static player* get_player ( player p) [static]

Create a player's object, initialize a player's structure.

This no longer sets the player map. Also, it now updates all the pointers so the caller doesn't need to do that. Caller is responsible for setting the correct map.

Redo this to do both get_player_ob and get_player. Hopefully this will be less bugfree and simpler.

Parameters:
pif NULL, a new player structure is created, else p is recycled.
Returns:
initialized player structure.

Definition at line 258 of file player.c.

References add_string(), arch_to_object(), bow_normal, pl::bowtype, CLEAR_FLAG, clear_los(), clear_player(), pl::do_los, liv::exp, pl::explore, fatal(), first_map_path, first_player, FLAG_READY_SKILL, pl::gen_sp_armour, get_player_archetype(), pl::language, pl::last_resist, pl::last_skill_exp, pl::last_skill_ob, pl::last_speed, pl::last_stats, pl::last_weapon_sp, pl::last_weight, pl::listening, socket_struct::look_position, socket_struct::monitor_spells, pl::next, pl::no_shout, NROFATTACKS, NUM_SKILLS, pl::ob, offsetof, OUT_OF_MEMORY, pl::outputs_count, pl::outputs_sync, pl::party, party_rejoin_if_exists, pl::peaceful, pet_normal, pl::petmode, range_none, pl::rejoin_party, roll_stats(), pl::savebed_map, pl::shoottype, pl::socket, ST_ROLL_STAT, pl::state, pl::Swap_First, pl::title, pl::unapply, unapply_nochoice, and socket_struct::update_look.

Referenced by add_player(), and receive_play_again().

Here is the call graph for this function:

Here is the caller graph for this function:

static archetype * get_player_archetype ( archetype *  at) [static]

Get next player archetype from archetype list.

Not very efficient routine, but used only creating new players.

Note:
there MUST be at least one player archetype! Will exit() if none.
Parameters:
atarchetype to search from.
Returns:
next player archetype available.

Definition at line 422 of file player.c.

References first_archetype, llevError, LOG(), and PLAYER.

Referenced by get_player(), and key_change_class().

Here is the call graph for this function:

Here is the caller graph for this function:

void give_initial_items ( object *  pl,
treasurelist items 
)

Gives a new player her initial items.

They will be god-given, and suitable for the player's race/restrictions.

Parameters:
plplayer.
itemstreasure list containing the items.

Now we do a second loop, to apply weapons/armors/... This is because weapons require the skill, which can be given after the first loop.

Definition at line 688 of file player.c.

References AP_NOPRINT, CLEAR_FLAG, create_treasure(), FLAG_APPLIED, FLAG_CAN_USE_SKILL, FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_INV_LOCKED, FLAG_NEUTRAL, FLAG_STARTEQUIP, FLAG_USE_ARMOUR, FLAG_USE_SHIELD, FLAG_USE_WEAPON, FORCE, free_object(), GT_ONLY_GOOD, GT_STARTEQUIP, IS_ARMOR, IS_SHIELD, IS_WEAPON, link_player_skills(), llevError, LOG(), manual_apply(), need_identify(), PLAYER, QUERY_FLAG, remove_ob(), SET_FLAG, SKILL, SPELL, and SPELLBOOK.

Referenced by apply_changes_to_player(), and key_change_class().

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* gravestone_text ( object *  op,
char *  buf2,
int  len 
) [static]

Create a text for a player's gravestobe.

Moved from apply.c to player.c - player.c is what actually uses this function. player.c may not be quite the best, a misc file for object actions is probably better, but there isn't one in the server directory.

Parameters:
opplayer.
buf2buffer to write the text to. Mustn't be NULL.
lenlength of buf2.
Returns:
buf2, containing gravestone text.

Definition at line 2982 of file player.c.

References MAX_BUF, PLAYER, and snprintf().

Referenced by kill_player().

Here is the call graph for this function:

Here is the caller graph for this function:

int handle_newcs_player ( object *  op)

Handles commands the player can send us, and various checks on invisibility, golem and such.

This is sort of special, in that the new client/server actually uses the new speed values for commands.

Parameters:
opplayer to handle.
Returns:
true if there are more actions we can do.

Definition at line 2826 of file player.c.

References draw_ext_info(), FLAG_MAKE_INVIS, FLAG_REMOVED, FLAG_SCARED, flee_player(), handle_client(), make_visible(), move_player(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_END, NDI_UNIQUE, pticks, QUERY_FLAG, and range_golem.

Referenced by process_players1().

Here is the call graph for this function:

Here is the caller graph for this function:

int hideability ( object *  ob)

Look at the surrounding terrain to determine the hideability of this object.

Positive levels indicate greater hideability.

Parameters:
obobject that may want to hide.
Returns:
the higher the value, the easier to hide here.

Definition at line 3755 of file player.c.

References freearr_x, freearr_y, get_map_flags(), has_carried_lights(), P_BLOCKSVIEW, and P_OUT_OF_MAP.

Referenced by attempt_hide(), and do_hidden_move().

Here is the call graph for this function:

Here is the caller graph for this function:

int is_true_undead ( object *  op)

Is the object a true undead?

Parameters:
opobject to test.
Returns:
1 if undead, 0 else.

Definition at line 3731 of file player.c.

References EXPERIENCE, FLAG_UNDEAD, PLAYER, and QUERY_FLAG.

Referenced by can_see_enemy(), and makes_invisible_to().

Here is the caller graph for this function:

void key_change_class ( object *  op,
char  key 
)

This function takes the key that is passed, and does the appropriate action with it (change race, or other things).

The function name is for historical reasons - now we have separate race and class; this actually changes the RACE, not the class.

Parameters:
opplayer.
keykey to handle.

Definition at line 1156 of file player.c.

References add_statbonus(), add_string(), allowed_class(), CLEAR_FLAG, copy_object(), create_treasure(), CS_QUERY_SINGLECHAR, draw_ext_info(), enter_exit(), esrv_new_player(), esrv_send_inventory(), esrv_update_item(), EVENT_BORN, EVENT_LOGIN, execute_global_event(), EXIT_PATH, EXIT_X, EXIT_Y, find_treasurelist(), first_map_ext_path, fix_object(), FLAG_WIZ, free_object(), free_string(), get_object(), get_player_archetype(), give_initial_items(), insert_ob_in_map(), link_player_skills(), llevDebug, Settings::localdir, LOG(), make_path_to_file(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_NEWPLAYER, NDI_BLUE, play_again(), Settings::playerdir, pticks, remove_ob(), remove_statbonus(), send_query(), SET_ANIMATION, settings, snprintf(), ST_PLAYING, start_info(), UPD_FACE, and update_object().

Referenced by reply_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

void key_confirm_quit ( object *  op,
char  key 
)

We receive the reply to the 'quit confirmation' message.

Parameters:
opplayer.
keyreply.

Definition at line 1278 of file player.c.

References check_score(), delete_character(), delete_map(), draw_ext_info(), draw_ext_info_format(), EVENT_REMOVE, execute_global_event(), first_map, FLAG_WAS_WIZ, Settings::localdir, MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, MSG_TYPE_ADMIN_PLAYER, NDI_ALL, NDI_DK_ORANGE, NDI_UNIQUE, mapdef::next, mapdef::path, play_again(), Settings::playerdir, QUERY_FLAG, remove_ob(), Settings::set_title, settings, snprintf(), ST_PLAYING, terminate_all_pets(), and TRUE.

Referenced by reply_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

void key_roll_stat ( object *  op,
char  key 
)

Player is currently swapping stats.

This code has been greatly reduced, because with set_attr_value and get_attr_value, the stats can be accessed just numeric ids. stat_trans is a table that translate the number entered into the actual stat. It is needed because the order the stats are displayed in the stat window is not the same as how the number's access that stat. The table does that translation.

Parameters:
opplayer.
keyreceived key.

Definition at line 1079 of file player.c.

References add_statbonus(), CHA, CON, CS_QUERY_SINGLECHAR, DEX, draw_ext_info(), draw_ext_info_format(), FLAG_WIZ, INT, llevError, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_NEWPLAYER, NDI_BLUE, NDI_UNIQUE, play_again(), POW, roll_stats(), send_query(), SET_ANIMATION, SET_FLAG, short_stat_name, ST_CHANGE_CLASS, STR, swap_stat(), and WIS.

Referenced by reply_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

void kill_player ( object *  op)

When a player should die (lack of hp, food, etc), we call this.

If the player can not be saved (permadeath, no lifesave), this will take care of removing the player file.

Will remove diseases, apply death penalties, and so on.

Takes battleground into account.

Parameters:
opplayer in jeopardy.
Todo:
describe battleground.

Definition at line 3238 of file player.c.

References add_string(), apply_death_exp_penalty(), arch_to_object(), Settings::balanced_stat_loss, BALSL_LOSS_CHANCE_RATIO, BALSL_MAX_LOSS_RATIO, BALSL_NUMBER_LOSSES_RATIO, change_attr_value(), check_score(), check_stat_bounds(), create_archetype(), cure_disease(), dead_player(), delete_character(), determine_god(), draw_ext_info(), draw_ext_info_format(), Settings::emergency_mapname, Settings::emergency_x, Settings::emergency_y, enter_player_savebed(), EVENT_DEATH, EVENT_PLAYER_DEATH, execute_event(), execute_global_event(), find_archetype(), fix_object(), FLAG_APPLIED, FLAG_UNIQUE, FLAG_WAS_WIZ, FLESH, FORCE_NAME, FREE_AND_COPY, free_object(), free_string(), get_attr_value(), GET_MAP_OB, gravestone_text(), insert_ob_in_map(), insert_ob_in_ob(), is_in_shop(), loot_object(), lose_msg, MAX, MAX_BUF, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END, MSG_TYPE_ATTRIBUTE_GOD, MSG_TYPE_ATTRIBUTE_STAT_LOSS, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_DIED, NDI_ALL, NDI_NAVY, NDI_UNIQUE, Settings::not_permadeth, NROFATTACKS, op_on_battleground(), play_again(), play_sound_player_only(), PREFER_LOW, present_arch_in_ob(), QUERY_FLAG, random_roll(), range_golem, remove_friendly_object(), remove_ob(), remove_unpaid_objects(), Settings::resurrection, save_life(), save_player(), SCRIPT_FIX_ALL, SET_FLAG, Settings::set_title, settings, snprintf(), SOUND_TYPE_LIVING, SPELL_EFFECT, Settings::stat_loss_on_death, transfer_ob(), and TRUE.

Referenced by check_login(), deep_swamp_type_process(), and kill_object().

Here is the call graph for this function:

Here is the caller graph for this function:

static void loot_object ( object *  op) [static]

Grab and destroy some treasure.

Parameters:
opobject to loot.

Definition at line 3195 of file player.c.

References apply_container(), CONTAINER, EXPERIENCE, FLAG_NO_DROP, FLAG_STARTEQUIP, FLAG_UNIQUE, free_object(), get_split_ob(), insert_ob_in_map(), QUERY_FLAG, and remove_ob().

Referenced by kill_player().

Here is the call graph for this function:

Here is the caller graph for this function:

void make_visible ( object *  op)

Makes an object visible again.

Parameters:
opwhat to make visible.

Definition at line 3712 of file player.c.

References FREE_AND_CLEAR_STR, PLAYER, and update_object().

Referenced by attack_ob_simple(), attempt_steal(), can_detect_enemy(), can_see_enemy(), do_hidden_move(), fire(), handle_newcs_player(), hide(), move_player_attack(), and player_attack_door().

Here is the call graph for this function:

Here is the caller graph for this function:

int move_player ( object *  op,
int  dir 
)

Player gave us a direction, check whether to move or fire.

Parameters:
opplayer.
dirdirection to move/fire.
Returns:
0.

Definition at line 2741 of file player.c.

References absdir(), animate_object(), check_pick(), do_hidden_move(), fire(), FLAG_CONFUSED, llevError, LOG(), MAP_IN_MEMORY, move_player_attack(), QUERY_FLAG, and turn_transport().

Referenced by cfapi_object_move(), command_fire(), command_run(), handle_newcs_player(), move_internal(), move_player_mover(), and pray_at_altar().

Here is the call graph for this function:

Here is the caller graph for this function:

void move_player_attack ( object *  op,
int  dir 
)

The player is also actually going to try and move (not fire weapons).

This function is just part of a breakup from move_player(). It should keep the code cleaner. When this is called, the players direction has been updated (taking into account confusion).

Parameters:
opplayer moving.
dirmoving direction.

Definition at line 2419 of file player.c.

References action_makes_visible(), DOOR, draw_ext_info(), FLAG_ALIVE, FLAG_CAN_ROLL, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FLAG_WIZ, freearr_x, freearr_y, get_map_from_coord(), GET_MAP_OB, get_owner(), LOCKED_DOOR, make_visible(), mon, move_ob(), MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_NOATTACK, op_on_battleground(), out_of_map(), OUT_OF_REAL_MAP, play_sound_map(), PLAYER, player_attack_door(), push_ob(), QUERY_FLAG, recursive_roll(), skill_attack(), and SOUND_TYPE_LIVING.

Referenced by move_player().

Here is the call graph for this function:

Here is the caller graph for this function:

int op_on_battleground ( object *  op,
int *  x,
int *  y,
archetype **  trophy 
)

Checks if the given object op (usually a player) is standing on a valid battleground-tile.

Function returns TRUE/FALSE. If true x, y returns the battleground -exit-coord. (and if x, y not NULL)

19 March 2005 - josh@woosworld.net modifed to check if the battleground also has slaying, maxhp, and maxsp set and if those are all set and the player has a marker that matches the slaying send them to a different x, y Default is to do the same as before, so only people wanting to have different points need worry about this

28 July 2008 - Modified to allow other archetypes than fingers as trophies. If other_arch is specified in the battleground floor, then that archetype will be used instead of the default ("finger"). -R.Q.

Parameters:
opobject to check.
[out]x
[out]yif not null and if on battleground (return 1), will contain the exit coordinates for the battleground.
[out]trophyif not null and if on battleground (return 1), will contain a pointer to the archetype that can be collected by the winner
Returns:
1 if op is on battleground, 0 else.

Definition at line 4002 of file player.c.

References BATTLEGROUND, EXIT_ALT_X, EXIT_ALT_Y, EXIT_PATH, EXIT_X, EXIT_Y, find_archetype(), FLAG_IS_FLOOR, FLAG_NO_PICK, FORCE, and QUERY_FLAG.

Referenced by hit_with_one_attacktype(), infect_object(), kill_object(), kill_player(), move_player_attack(), should_arena_attack(), and spell_find_dir().

Here is the call graph for this function:

Here is the caller graph for this function:

int path_to_player ( object *  mon,
object *  pl,
unsigned  mindiff 
)

Returns the direction to the player, if valid.

Returns 0 otherwise.

Modified to verify there is a path to the player. Does this by stepping towards player and if path is blocked then see if blockage is close enough to player that direction to player is changed (ie zig or zag). Continue zig zag until either reach player or path is blocked. Thus, will only return true if there is a free path to player. Though path may not be a straight line. Note that it will find player hiding along a corridor at right angles to the corridor with the monster.

Modified by MSW 2001-08-06 to handle tiled maps. Various notes:

  • With DETOUR_AMOUNT being 2, it should still go and find players hiding down corriders.
  • I think the old code was broken if the first direction the monster should move was blocked - the code would store the first direction without verifying that the player can actually move in that direction. The new code does not store anything in firstdir until we have verified that the monster can in fact move one space in that direction.
  • I'm not sure how good this code will be for moving multipart monsters, since only simple checks to blocked are being called, which could mean the monster is blocking itself.
Parameters:
monsource object.
pltarget.
mindiffminimal distance mon and pl should have.
Returns:
direction from mon to pl, 0 if can't get there.

Definition at line 556 of file player.c.

References absdir(), blocked_link(), DETOUR_AMOUNT, rv_vector::direction, rv_vector::distance, rv_vector::distance_x, rv_vector::distance_y, FABS, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, get_rangevector(), get_rangevector_from_mapcoord(), MAX, MAX_SPACES, MOVE_ALL, OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, and P_OUT_OF_MAP.

Referenced by monster_cast_spell(), monster_use_range(), monster_use_scroll(), and monster_use_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

static object* pick_arrow_target ( object *  op,
const char *  type,
int  dir 
) [static]

Looks in a given direction, finds the first valid target, and calls find_better_arrow() to find a decent arrow to use.

Parameters:
opshooter.
typearrow's race to search for (the bow's usually).
dirfire direction.
Returns:
suitable arrow, or NULL if none found.

Definition at line 1852 of file player.c.

References die_roll(), find_arrow(), find_better_arrow(), FLAG_ALIVE, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, MOVE_FLY_LOW, P_BLOCKSVIEW, P_IS_ALIVE, P_OUT_OF_MAP, PREFER_LOW, and QUERY_FLAG.

Referenced by player_fire_bow().

Here is the call graph for this function:

Here is the caller graph for this function:

void play_again ( object *  op)

Ask the player whether to play again or disconnect.

Parameters:
opplayer.

Definition at line 810 of file player.c.

References CS_QUERY_SINGLECHAR, FLAG_REMOVED, QUERY_FLAG, remove_ob(), send_query(), and ST_PLAY_AGAIN.

Referenced by apply_savebed(), command_shutdown(), key_change_class(), key_confirm_quit(), key_roll_stat(), kill_player(), and receive_play_again().

Here is the call graph for this function:

Here is the caller graph for this function:

static int player_attack_door ( object *  op,
object *  door 
) [static]

Player is "attacking" a door.

Will try to open it with a key, or warn if can't open it.

Moved out of move_player_attack().

Return values:
1player has opened the door with a key such that the caller should not do anything more.
0nothing happened.

Definition at line 2361 of file player.c.

References action_makes_visible(), AT_PHYSICAL, decrease_ob, DOOR, draw_ext_info(), draw_ext_info_format(), esrv_update_item(), find_key(), hit_player(), HUGE_BUF, LOCKED_DOOR, make_visible(), MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_NOKEY, MSG_TYPE_ITEM, MSG_TYPE_ITEM_REMOVE, NDI_BROWN, NDI_NAVY, NDI_UNIQUE, play_sound_map(), query_short_name(), remove_locked_door(), RUNE, SOUND_TYPE_GROUND, spring_trap(), TRAP, and UPD_WEIGHT.

Referenced by move_player_attack().

Here is the call graph for this function:

Here is the caller graph for this function:

int player_can_view ( object *  pl,
object *  op 
)

Check the player los field for viewability of the object op.

This function works fine for monsters, but we dont worry if the object isnt the top one in a pile (say a coin under a table would return "viewable" by this routine). Another question, should we be concerned with the direction the player is looking in? Realistically, most of use cant see stuff behind our backs...on the other hand, does the "facing" direction imply the way your head, or body is facing? Its possible for them to differ. Sigh, this fctn could get a bit more complex. -b.t.

This function is now map tiling safe.

Parameters:
plplayer that may see op.
opwhat may be seen by pl.
Return values:
-1pl isn't a player
0pl can't see op.
1pl can see op.

Definition at line 3906 of file player.c.

References rv_vector::distance_x, rv_vector::distance_y, FABS, get_rangevector(), llevError, LOG(), and PLAYER.

Referenced by can_see_enemy().

Here is the call graph for this function:

Here is the caller graph for this function:

static int player_fire_bow ( object *  op,
int  dir 
) [static]

Special fire code for players - this takes into account the special fire modes players can have but monsters can't.

Putting that code here makes the fire_bow() code much cleaner.

This function should only be called if 'op' is a player, hence the function name.

Parameters:
opplayer.
dirfiring direction.
Returns:
1 if arrow was fired, 0 else.

Definition at line 2106 of file player.c.

References absdir(), bow_bestarrow, bow_n, bow_nw, bow_spreadshot, bow_threewide, fire_bow(), freearr_x, freearr_y, pick_arrow_target(), range_bow, and similar_direction().

Referenced by fire().

Here is the call graph for this function:

Here is the caller graph for this function:

void player_unready_range_ob ( player pl,
object *  ob 
)

Unready an object for a player.

This function does nothing if the object was not readied.

Parameters:
plplayer.
obobject to unready.

Definition at line 4221 of file player.c.

References range_none, range_size, pl::ranges, and pl::shoottype.

Referenced by become_follower(), check_special_prayers(), and do_forget_spell().

Here is the caller graph for this function:

int playername_ok ( const char *  cp)

Is the player name valid.

Parameters:
cpname to test.
Returns:
0 if invalid, 1 if valid.

Definition at line 230 of file player.c.

Referenced by check_name().

Here is the caller graph for this function:

void receive_play_again ( object *  op,
char  key 
)

Player replied to play again / disconnect.

Parameters:
opplayer.
keyreceived choice.

Definition at line 839 of file player.c.

References add_friendly_object(), add_refcount(), add_string(), draw_ext_info(), FREE_AND_CLEAR_STR, free_object(), get_name(), get_player(), leave(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, NDI_UNIQUE, pl::ob, play_again(), remove_friendly_object(), and set_first_map().

Referenced by reply_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

void remove_unpaid_objects ( object *  op,
object *  env,
int  free_items 
)

This goes throws the inventory and removes unpaid objects, and puts them back in the map (location and map determined by values of env) or frees them.

This function will descend into containers.

Parameters:
opobject to start the search from.
envtop-level container, should be in a map if free_items is 0, unused if free_items is 1.
free_itemsif set, unpaid items are freed, else they are inserted in the same map as env.

Definition at line 2943 of file player.c.

References FLAG_UNPAID, free_object(), insert_ob_in_map(), QUERY_FLAG, remove_ob(), and remove_unpaid_objects().

Referenced by check_login(), kill_player(), and remove_unpaid_objects().

Here is the call graph for this function:

Here is the caller graph for this function:

void roll_again ( object *  op)

Ask the player what to do with the statistics.

Parameters:
opplayer.

Definition at line 1006 of file player.c.

References CS_QUERY_SINGLECHAR, esrv_new_player(), and send_query().

Referenced by receive_player_password().

Here is the call graph for this function:

Here is the caller graph for this function:

int roll_stat ( void  )

This rolls four 1-6 rolls and sums the best 3 of the 4.

Returns:
sum of rolls.

Definition at line 908 of file player.c.

Referenced by roll_stats().

Here is the caller graph for this function:

void roll_stats ( object *  op)

Roll the initial player's statistics.

Parameters:
opplayer to roll for.

Definition at line 932 of file player.c.

References fix_object(), and roll_stat().

Referenced by get_player(), and key_roll_stat().

Here is the call graph for this function:

Here is the caller graph for this function:

static int save_life ( object *  op) [static]

Can the player be saved by an item?

Parameters:
opplayer to try to save.
Return values:
1player had his life saved by an item, first item saving life is removed.
0player had no life-saving item.

Definition at line 2899 of file player.c.

References CLEAR_FLAG, draw_ext_info_format(), enter_player_savebed(), fix_object(), FLAG_APPLIED, FLAG_LIFESAVE, free_object(), llevError, LOG(), MAX_BUF, MSG_TYPE_ITEM, MSG_TYPE_ITEM_REMOVE, NDI_UNIQUE, play_sound_map(), QUERY_FLAG, query_name(), remove_ob(), and SOUND_TYPE_ITEM.

Referenced by kill_player().

Here is the call graph for this function:

Here is the caller graph for this function:

void send_news ( const object *  op)

Send the news to a player.

Parameters:
opplayer to send to.

Definition at line 176 of file player.c.

References close_and_delete(), Settings::confdir, draw_ext_info_format(), HUGE_BUF, llevDebug, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS, NDI_GREEN, NDI_UNIQUE, Settings::news, open_and_uncompress(), settings, snprintf(), and strip_endline().

Referenced by add_player(), and command_news().

Here is the call graph for this function:

Here is the caller graph for this function:

void send_rules ( const object *  op)

Send the rules to a player.

Parameters:
opplayer to send rules to.

Definition at line 142 of file player.c.

References close_and_delete(), Settings::confdir, draw_ext_info(), HUGE_BUF, llevDebug, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_RULES, NDI_GREEN, NDI_UNIQUE, open_and_uncompress(), Settings::rules, settings, and snprintf().

Referenced by add_player(), and command_rules().

Here is the call graph for this function:

Here is the caller graph for this function:

static void set_first_map ( object *  op) [static]

This loads the first map an puts the player on it.

Parameters:
opplayer to put on map.

Definition at line 368 of file player.c.

References enter_exit(), and first_map_path.

Referenced by add_player(), and receive_play_again().

Here is the call graph for this function:

Here is the caller graph for this function:

int stand_near_hostile ( object *  who)

Determine if who is standing near a hostile creature.

Parameters:
whoobject to check.
Returns:
1 if near a monster, 0 else.

Definition at line 3837 of file player.c.

References FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FLAG_WIZ, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, PLAYER, and QUERY_FLAG.

Referenced by attempt_hide().

Here is the call graph for this function:

Here is the caller graph for this function:

static void swap_stat ( object *  op,
int  Swap_Second 
) [static]

Player finishes selecting what stats to swap.

Parameters:
opplayer.
Swap_Secondsecond statistic to swap.
Todo:
why the reinit of exp/ac/...?

Definition at line 1020 of file player.c.

References draw_ext_info_format(), fix_object(), get_attr_value(), llevError, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_NEWPLAYER, NDI_UNIQUE, set_attr_value(), and short_stat_name.

Referenced by key_roll_stat().

Here is the call graph for this function:

Here is the caller graph for this function:

static int turn_one_transport ( object *  transport,
object *  captain,
int  dir 
) [static]

Turn a transport to an adjacent direction (+1 or -1), updating the move_type flags in the same process.

Parameters:
transportwhat to turn. Must be of type TRANSPORT.
captainwho wants to turn the boat.
dirdirection to turn to.
Returns:
  • 1 if the transport turned (so can't move anymore this tick)
  • 2 if the transport couldn't turn

Definition at line 2639 of file player.c.

References animate_object(), pl::do_los, esrv_map_scroll(), freearr_x, freearr_y, insert_ob_in_map(), insert_ob_in_map_at(), ob_blocked(), PLAYER, remove_ob(), TRANSPORT, and update_transport_block().

Referenced by turn_transport().

Here is the call graph for this function:

Here is the caller graph for this function:

static int turn_transport ( object *  transport,
object *  captain,
int  dir 
) [static]

Try to turn a transport in the desired direction.

This takes into account transports that turn and don't occupy the same space depending on the direction it is facing. The transport MUST be a square for it to turn correctly when adjusting tile occupation.

Parameters:
transportwhat to turn. Must be of type TRANSPORT.
captainwho wants to turn the boat.
dirdirection to turn to.
Returns:
  • 0 if transport is in the right direction
  • 1 if the transport turned (so can't move anymore this tick)
  • 2 if the transport couldn't turn

Definition at line 2711 of file player.c.

References absdir(), animate_object(), get_ob_key_value(), TRANSPORT, and turn_one_transport().

Referenced by move_player().

Here is the call graph for this function:

Here is the caller graph for this function:

static void update_transport_block ( object *  transport,
int  dir 
) [static]

Update the move_type of a transport based on the direction.

The transport MUST be square. Depending on the direction, the right column of tiles or the bottom line of tiles will have a move_type of 0.

Parameters:
transportwhat to update.
dirdirection to update flags for.

Definition at line 2594 of file player.c.

References get_multi_size().

Referenced by turn_one_transport().

Here is the call graph for this function:

Here is the caller graph for this function: