--- deliantra/server/include/player.h 2006/02/03 07:12:50 1.1 +++ deliantra/server/include/player.h 2006/08/27 17:59:26 1.8 @@ -37,7 +37,7 @@ /* wand/rod/horn rolled into range_misc. They all use the same body location * anyways. */ -typedef enum rangetype { +enum rangetype { range_bottom = -1, range_none = 0, range_bow = 1, @@ -47,9 +47,9 @@ range_skill = 5, range_builder = 6, range_size = 7 -} rangetype; +}; -typedef enum _bowtype { +enum bowtype_t { bow_normal = 0, bow_threewide = 1, bow_spreadshot = 2, @@ -62,7 +62,7 @@ bow_w = 9, bow_nw = 10, /* must stay at 10 */ bow_bestarrow = 11 -} bowtype_t; +}; typedef enum _petmode { pet_normal = 0, @@ -106,15 +106,12 @@ uint32 kills; } partylist; -typedef struct pl { - struct pl *next; /* Pointer to next player, NULL if this is last */ - NewSocket socket; /* Socket information for this player */ - char maplevel[MAX_BUF]; /* On which level is the player? */ - struct mapdef *loading; /* When entering a map in progress of loading, not really used */ - char savebed_map[MAX_BUF]; /* map where player will respawn after death */ - sint16 bed_x, bed_y; /* x,y - coordinates of respawn (savebed) */ +// memsettable part of player +struct player_memset +{ + object *ob; /* The object representing the player */ + mapstruct *loading; /* When entering a map in progress of loading, not really used */ rangetype shoottype; /* Which range-attack is being used by player */ - char spellparam[MAX_BUF]; /* What param to add to spells */ bowtype_t bowtype; /* which firemode? */ petmode_t petmode; /* which petmode? */ object *ranges[range_size];/* object for each range. Set up in fix player. Note */ @@ -139,7 +136,7 @@ /* Try to put all the bitfields together - saves some small amount of memory */ uint32 braced:1; /* Will not move if braced, only attack */ uint32 tmp_invis:1; /* Will invis go away when we attack ? */ - const char *invis_race;/* What race invisible to? */ + const char *invis_race; /* What race invisible to? */ uint32 do_los:1; /* If true, need to call update_los() in draw(), and clear */ uint32 fire_on:1; /* Player should fire object, not move */ uint32 run_on:1; /* Player should keep moving in dir until run is off */ @@ -166,13 +163,17 @@ float last_speed; /* Last speed as sent to client */ sint16 last_resist[NROFATTACKS]; /* last resist values sent to client */ int Swap_First; /* First stat player has selected to swap */ - object *ob; /* The object representing the player */ object *last_used; /* Pointer to object last picked or applied */ uint32 last_used_id; /* Safety measures to be sure it's the same */ sint8 blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]; /* array showing what spaces */ /* the player can see. For maps smaller than */ /* MAP_CLIENT_.., the upper left is used */ + sint16 bed_x, bed_y; /* x,y - coordinates of respawn (savebed) */ + char savebed_map[MAX_BUF]; /* map where player will respawn after death */ + char maplevel[MAX_BUF]; /* On which level is the player? */ + char spellparam[MAX_BUF]; /* What param to add to spells */ + char own_title[MAX_NAME]; /* Title the player has chosen for themself */ /* Note that for dragon players, this is filled in for them */ char title[BIG_NAME]; /* Default title, like fighter, wizard, etc */ @@ -206,7 +207,17 @@ uint16 outputs_count; /* Print if this count is exceeded */ object *mark; /* marked object */ uint32 mark_count; /* count of mark object */ + object *transport; /* transport the player is in */ /* Special DM fields */ tag_t* stack_items; /* Item stack for patch/dump/... commands */ int stack_position; /* Current stack position, 0 for no item */ +}; + +typedef struct pl : player_memset, attachable +{ + static data_type get_dt () { return DT_PLAYER; } + + struct pl *next; /* Pointer to next player, NULL if this is last */ + NewSocket socket; /* Socket information for this player */ } player; +