--- deliantra/server/include/player.h 2006/12/22 16:34:00 1.31 +++ deliantra/server/include/player.h 2006/12/23 06:21:02 1.32 @@ -110,9 +110,10 @@ ACC_CLASS (player) -// memsettable part of player -struct player_pod +struct player : zero_initialised, refcounted, attachable { + player *ACC (RW, next); /* Pointer to next player, NULL if this is last */ + client *ACC (RO, ns); /* Socket information for this player */ object_ptr ACC (RW, ob); /* The object representing the player */ maptile *loading; /* When entering a map in progress of loading, not really used */ rangetype shoottype; /* Which range-attack is being used by player */ @@ -142,7 +143,6 @@ uint32 ACC (RO, fire_on):1; /* Player should fire object, not move */ uint32 ACC (RO, run_on):1; /* Player should keep moving in dir until run is off */ uint32 ACC (RO, has_hit):1; /* If set, weapon_sp instead of speed will count */ - uint32 ACC (RO, name_changed):1; /* If true, the player has set a name. */ uint32 ACC (RO, peaceful):1; /* If set, won't attack friendly creatures */ uint32 ACC (RO, hidden):1; /* If True, player (DM) is hidden from view */ uint32 ACC (RO, explore):1; /* if True, player is in explore mode */ @@ -198,28 +198,13 @@ tag_t *stack_items; /* Item stack for patch/dump/... commands */ int ACC (RW, stack_position); /* Current stack position, 0 for no item */ 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 */ -}; + /* the player can see. For maps smaller than */ + /* MAP_CLIENT_.., the upper left is used */ -struct player : zero_initialised, attachable, player_pod -{ - player *ACC (RW, next); /* Pointer to next player, NULL if this is last */ - client *ACC (RO, ns); /* Socket information for this player */ shstr ACC (RW, invis_race); /* What race invisible to? */ bool ACC (RW, enable_save); Output_Buf outputs[NUM_OUTPUT_BUFS]; /* holds output strings to client */ - void clear () - { - memset (static_cast < player_pod * >(this), 0, sizeof (player_pod)); - attachable_clear (); - invis_race = 0; - - for (int i = 0; i < NUM_OUTPUT_BUFS; i++) - outputs[i].buf = 0; - } - static player *create (); static player *load (const char *path); void save (bool final = false);